[docs] [issue27124] binascii.a2b_hex raises binascii.Error and ValueError, not TypeError
Steven D'Aprano
report at bugs.python.org
Wed May 25 12:23:49 EDT 2016
Steven D'Aprano added the comment:
In Python 3.x, 'a' is just as much a Unicode string as 'ä'. I agree that binascii.a2b_hex should raise ValueError for argument 'ä', or ';' for that matter, as they are invalid values. There's an inconsistency in why some invalid characters raise ValueError and some raise binascii.Error. But since binascii.Error is a subclass of ValueError, it probably doesn't matter that much, so long as the documentation is clear.
----------
nosy: +steven.daprano
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27124>
_______________________________________
More information about the docs
mailing list