Issue #4770: Restrict binascii module to accept only bytes (as specified).

And fix the email package to encode to ASCII instead of ``raw-unicode-escape`` before ASCII-to-binary decoding.
This commit is contained in:
Florent Xicluna 2010-07-27 21:20:15 +00:00
parent 4bf70686fa
commit f1046ca817
7 changed files with 42 additions and 22 deletions

View file

@ -213,6 +213,7 @@ class StructTest(unittest.TestCase):
expected = '%x' % expected
if len(expected) & 1:
expected = "0" + expected
expected = expected.encode('ascii')
expected = unhexlify(expected)
expected = (b"\x00" * (self.bytesize - len(expected)) +
expected)