This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mgiuca
Recipients belopolsky, ezio.melotti, georg.brandl, lemburg, mgiuca, pitrou, vstinner
Date 2010-12-30.02:37:20
SpamBayes Score 5.3794613e-10
Marked as misclassified No
Message-id <1293676642.4.0.746877108447.issue8821@psf.upfronthosting.co.za>
In-reply-to
Content
> 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?
History
Date User Action Args
2010-12-30 02:37:22mgiucasetrecipients: + mgiuca, lemburg, georg.brandl, belopolsky, pitrou, vstinner, ezio.melotti
2010-12-30 02:37:22mgiucasetmessageid: <1293676642.4.0.746877108447.issue8821@psf.upfronthosting.co.za>
2010-12-30 02:37:20mgiucalinkissue8821 messages
2010-12-30 02:37:20mgiucacreate