mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
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:
parent
4bf70686fa
commit
f1046ca817
7 changed files with 42 additions and 22 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue