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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Patch committed in r77506, r77507, r77508 and r77509. Thank you! -- resolution: -> fixed status: open -> closed ___ Python tracker ___

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15873/binascii_b2a_uu_length-2.patch ___ Python tracker ___ ___ Python-bug

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

2010-01-14 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file15871/binascii_b2a_uu_length.patch ___ Python tracker ___ ___ Python-bugs-

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

2010-01-14 Thread STINNER Victor
STINNER Victor added the comment: > The patch doesn't apply cleanly against trunk Because of r77497 (issue #770). No problem, here is the new patch. I'm now using a git-svn repository to keep all my patches. It's much easier to update them to trunk ;-) > Also, it would be nice to add a test.

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch doesn't apply cleanly against trunk (due to today's commits I fear, sorry). Also, it would be nice to add a test. -- ___ Python tracker _

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

2010-01-14 Thread STINNER Victor
STINNER Victor 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 esti

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

2010-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: >>> [len(binascii.b2a_uu("x"*bin_len)) for bin_len in xrange(10)] [2, 6, 6, 6, 10, 10, 10, 14, 14, 14] >>> [(2+(bin_len+2)*4//3) for bin_len in xrange(10)] [4, 6, 7, 8, 10, 11, 12, 14, 15, 16] How is this the correct estimation? The results are diff

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

2010-01-14 Thread STINNER Victor
New submission from STINNER Victor : binascii_b2a_uu() estimate the output string length using 2+bin_len*2. It's almost correct... except for bin_len=1. The result is a memory write into unallocated memory: $ ./python -c "import binascii; binascii.b2a_uu('x')" Debug memory block at address