[issue4770] binascii module, crazy error messages, unexpected behavior

flox report at bugs.python.org
Mon Dec 14 20:03:30 CET 2009


flox <laxyf at yahoo.fr> added the comment:

I agree, we need consistency between all functions of this package.

I've run a small script to check what happens for all 16 functions of
the binascii package when they receive unicode input...

See attached script (and sample output).

IMHO 4 functions should be fixed to raise the same TypeError:
 - a2b_hex
 - a2b_qp
 - unhexlify
 - rledecode_hqx 

Documentation says that the functions in `binary` module « convert
between binary and various ASCII-encoded binary representations »
So... it's all binary.

Implicit encoding should not happen, never.

----------
nosy: +flox
versions: +Python 3.1, Python 3.2 -Python 3.0
Added file: http://bugs.python.org/file15559/case_binascii.py

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


More information about the Python-bugs-list mailing list