From: Bob Halley Date: Sun, 31 Aug 2014 23:59:30 +0000 (-0700) Subject: Fix some issues with dns.zone.to_file(). X-Git-Tag: v1.12.0-py3~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f94224d330ee4204eb9cd6a3225e7f08787cf614;p=thirdparty%2Fdnspython.git Fix some issues with dns.zone.to_file(). --- diff --git a/dns/zone.py b/dns/zone.py index c1b02236..a5f4f9c1 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -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() diff --git a/tests/zone.py b/tests/zone.py index a1346098..61f41480 100644 --- a/tests/zone.py +++ b/tests/zone.py @@ -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)