[issue7701] fix output string length for binascii.b2a_uu()

STINNER Victor report at bugs.python.org
Thu Jan 14 14:43:39 CET 2010


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> How is this the correct estimation? The results are different.

The estimation have be bigger or equal, but not smaller.

> Try the following:
> >>> [(2+(bin_len+2)//3*4) for bin_len in xrange(10)]
> [2, 6, 6, 6, 10, 10, 10, 14, 14, 14]

Cool, it's not an estimation but the exact result :-) I prefer to leave the resize unchanged. The new patch uses your "estimation" ;-)

----------
Added file: http://bugs.python.org/file15873/binascii_b2a_uu_length-2.patch

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


More information about the Python-bugs-list mailing list