]> granicus.if.org Git - python/commit
SF #1022953: binascii.a2b_hqx("") raises SystemError
authorRaymond Hettinger <python@rcn.com>
Mon, 6 Sep 2004 22:58:37 +0000 (22:58 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 6 Sep 2004 22:58:37 +0000 (22:58 +0000)
commit658717ed117c8002d084359a3ad2f88ca7df8c99
tree1e884ec59e3510ccc4db99290cc133f6550b43a1
parent8158e849305d0e0ab3e19cdc93a86bb7d5fc0651
SF #1022953:  binascii.a2b_hqx("") raises SystemError

Several functions adopted the strategy of altering a full lengthed
string copy and resizing afterwards.  That would fail if the initial
string was short enough (0 or 1) to be interned.  Interning precluded
the subsequent resizing operation.

The solution was to make sure the initial string was at least two
characters long.

Added tests to verify that all binascii functions do not crater when
given an empty string argument.
Lib/test/test_binascii.py
Modules/binascii.c