]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Fix some issues with dns.zone.to_file().
authorBob Halley <halley@dnspython.org>
Sun, 31 Aug 2014 23:59:30 +0000 (16:59 -0700)
committerBob Halley <halley@dnspython.org>
Sun, 31 Aug 2014 23:59:30 +0000 (16:59 -0700)
dns/zone.py
tests/zone.py

index c1b02236fc780157591765e4f0f44afae84f6bc5..a5f4f9c1fc441edcca001faed7c3bd30e99baec6 100644 (file)
@@ -507,7 +507,7 @@ class Zone(object):
         LF on POSIX, CRLF on Windows, CR on Macintosh).
         @type nl: string or None
         """
-        temp_buffer = io.StringIO()
+        temp_buffer = io.BytesIO()
         self.to_file(temp_buffer, sorted, relativize, nl)
         return_value = temp_buffer.getvalue()
         temp_buffer.close()
index a1346098fc5c08f623b41377a2a451d82baaeea1..61f414806d3864b0ee1280993a005c63bc3deaab 100644 (file)
@@ -133,7 +133,7 @@ class ZoneTestCase(unittest.TestCase):
         finally:
             if not _keep_output:
                 os.unlink('example3.out')
-        self.failUnless(ok)
+        self.assertTrue(ok)
 
     def testFromText(self):
         z = dns.zone.from_text(example_text, 'example.', relativize=True)