]> granicus.if.org Git - python/commit
Fix for bug #661136
authorJust van Rossum <just@letterror.com>
Fri, 3 Jan 2003 11:18:56 +0000 (11:18 +0000)
committerJust van Rossum <just@letterror.com>
Fri, 3 Jan 2003 11:18:56 +0000 (11:18 +0000)
commit9a3129c14866f21ce3cee053c085db374cb61b78
tree5a272492b7a8767ab73dc23cb7b69b98ecb2a6ac
parent1618cedfacdeda58d2837f138ff815439232e3ae
Fix for bug #661136
Lesson learned: kids should not be allowed to use API's starting
with an underscore :-/
zipimport in 2.3a1 is even more broken than I thought: I attemped
to _PyString_Resize a string created by PyString_FromStringAndSize,
which fails for strings with length 0 or 1 since the latter returns
an interned string in those cases. This would cause a SystemError
with empty source files (and no matching pyc) in the zip archive.
I rewrote the offending code to simply allocate a new buffer and
avoid _PyString_Resize altogether.
Added a test that would've caught the problem.
Lib/test/test_zipimport.py
Modules/zipimport.c