[issue13637] binascii.a2b_* functions could accept unicode strings

Vajrasky Kok report at bugs.python.org
Sat Nov 2 14:43:42 CET 2013


Vajrasky Kok added the comment:

Here is another patch to better the error message. Right now, the error message when wrong input sent to unhexlify is a little bit funny.

>>> import binascii
>>> binascii.unhexlify(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument should be bytes, buffer or ASCII string, not <class 'int'>

After patch:
>>> import binascii
>>> binascii.unhexlify(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument should be bytes, buffer or ASCII string, not int

----------
Added file: http://bugs.python.org/file32463/better_error_message_binascii.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13637>
_______________________________________


More information about the Python-bugs-list mailing list