Message124901
> 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? |
|
Date |
User |
Action |
Args |
2010-12-30 02:37:22 | mgiuca | set | recipients:
+ mgiuca, lemburg, georg.brandl, belopolsky, pitrou, vstinner, ezio.melotti |
2010-12-30 02:37:22 | mgiuca | set | messageid: <1293676642.4.0.746877108447.issue8821@psf.upfronthosting.co.za> |
2010-12-30 02:37:20 | mgiuca | link | issue8821 messages |
2010-12-30 02:37:20 | mgiuca | create | |
|