[New-bugs-announce] [issue27124] binascii.a2b_hex raises binascii.Error, not TypeError

Lennart Grahl report at bugs.python.org
Wed May 25 11:42:31 EDT 2016

New submission from Lennart Grahl:

When using binascii.a2b_hex (or binascii.unhexlify) and the argument is invalid, the doc states that it should raise a TypeError for invalid arguments (e.g. passing an odd-length string).

However, it does raise binascii.Error instead of TypeError:

except Exception as exc:

assignee: docs at python
components: Documentation
messages: 266368
nosy: Lennart Grahl, docs at python
priority: normal
severity: normal
status: open
title: binascii.a2b_hex raises binascii.Error, not TypeError
type: behavior
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list