Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TIP #601 bug: handling of '-buffersize'

Closed / Fixed4dbfa46caa1aad3dc2e359b0d36e35244a623a94Created 5 years agoUpdated 5 years ago
Descriptionwiki2022-03-18 15:24:02
A number of test-cases started failing in Tcl 9.0 as a result of TIP #601 That was expected, since testcases which depend on replacing invalid characters with '?' now should throw an exception.

However, there were two testcases (for 9.0) which puzzled me:

I marked those with "knownBug". My first investigation hints that this is - indeed - a bug in the current TIP #601 implementation.

Those 2 testcases don't throw an exception, but they truncate the channel one more byte than expected. The cause of this is an invalid byte at the end of the stream, as a result of the truncation. But .... the stream is truncated as a result of the channel's "-buffersize" option, we don't know yet whether this byte is really invalid or not: It could still be followed by more bytes, forming a valid utf-8 byte sequence. Conclusion: when a channel's '-buffersize' is used, we have to accept 'invalid' bytes at the end of the stream as before.

Referenced by3
jan.nijtmans Ticket [4dbfa46caa]: 3 changes [History diff]2022-03-18 15:24:15
jan.nijtmanswiki2022-03-21 12:04:25

Fixed [here]

Log in (anonymous is fine) to add a comment.