summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-07-27 21:20:15 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-07-27 21:20:15 (GMT)
commitf1046ca8173380e2c320c56e1cdc911493371057 (patch)
treec3eabb51cc16a958e1fd1ca6700036d8b365d48b /Lib/test/test_struct.py
parent4bf70686fab91dcc5603c11c36f77bd2131ff6ed (diff)
downloadcpython-f1046ca8173380e2c320c56e1cdc911493371057.zip
cpython-f1046ca8173380e2c320c56e1cdc911493371057.tar.gz
cpython-f1046ca8173380e2c320c56e1cdc911493371057.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r--Lib/test/test_struct.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index b923f45..6ca35ca 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -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)