Should reject Unicode strings in Python 3.x
Bug #1084873 reported by
Craig McQueen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python-Crypto |
Confirmed
|
High
|
Unassigned |
Bug Description
The docs in PyPI give an example:
>>> from Crypto.Cipher import AES
>>> obj = AES.new('This is a key456', AES.MODE_ECB)
>>> message = "The answer is no"
>>> ciphertext = obj.encrypt(
>>> ciphertext
'o\x1aq_
In Python 3.x, the encrypt function shouldn't accept the Unicode string input. It should only accept a byte string input. I.e. it should only work if we change the third line to:
>>> message = b"The answer is no"
Changed in pycrypto: | |
importance: | Undecided → High |
To post a comment you must log in.
Agreed. PyCrypto should behave like a Python 3 user would expect when running under Python 3.