Matt Giuca <matt.gi...@gmail.com> added the comment:

> I think that we have good reasons to not remove the NUL character.

Please note: Nobody is suggesting that we remove the NUL character. I was 
merely suggesting that we don't rely on it where it is unnecessary.

Returning to my original patch: If the code was using the NUL character as a 
terminator, then it wouldn't be a bug.

What the repr code does is it uses the length, and does not explicitly search 
for a NUL character. However, there is a *bug* where it reads one too many 
characters in certain cases. As I said in the first place, it just happens to 
*not* be catastrophic due to the presence of the NUL character. But that does 
not mean this isn't a bug -- at the very least, the code is very confusing to 
read because it does not do what it is trying to do.

Anyway the important issue is what Marc-Andre raised about buffers. Since we 
are in agreement that there is a potential problem here, and I have a patch 
which seems correct and doesn't break any test cases (note my above post 
responding to test case breakages), can it be applied?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8821>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to