From: Bob Halley Date: Sat, 18 Jun 2016 13:51:36 +0000 (-0700) Subject: Fix another Python 2/3 code merge unicode issue. X-Git-Tag: v1.15.0~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=257f2ae5d3c4e4dc93ccd472c4717c6b705c6e6d;p=thirdparty%2Fdnspython.git Fix another Python 2/3 code merge unicode issue. --- diff --git a/dns/name.py b/dns/name.py index 7a874b82..5d017a35 100644 --- a/dns/name.py +++ b/dns/name.py @@ -123,7 +123,7 @@ def _escapify(label, unicode_mode=False): if c >= u'\x7f': text += c else: - text += u'\\%03d' % c + text += u'\\%03d' % ord(c) return text diff --git a/tests/test_name.py b/tests/test_name.py index a166a3e8..645cf759 100644 --- a/tests/test_name.py +++ b/tests/test_name.py @@ -237,6 +237,11 @@ class NameTestCase(unittest.TestCase): t = n.to_text() self.assertEqual(t, b'FOO\.bar') + def testToText9(self): + n = dns.name.from_text(r'\x80\.bar', origin=None) + t = n.to_text() + self.assertEqual(t, br'x80\.bar') + def testSlice1(self): n = dns.name.from_text(r'a.b.c.', origin=None) s = n[:]