Overview
| Artifact ID: | d3aa224dd6170682be124e218ca6a94781408a5ff0d28a04215e7708664d592f |
|---|---|
| Ticket: | 1bedc53c8cb878f0bf2a9b65c83b9e481f85fb47
synchronous [read] with -strictencoding does not produce an error on invalid input |
| User & Date: | pooryorick on 2022-12-27 21:51:54 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
In trunk, test io-12.9, "ReadChars: multibyte chars split FAILED" does not result in an error when the test is changed so that the channel is configured with -strictencdoing 1: <code><verbatim> test io-12.9 {ReadChars: multibyte chars split} -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 close $f set f [open $path(test1)] fconfigure $f -strictencoding 1 -encoding utf-8 -buffersize 10 set in [read $f] close $f scan [string index $in end] %c } -cleanup { catch {close $f} } -result 194 </verbatim></code> This is incorrect. An error should be returned. If a second [read] is added, it returns an error: <code><verbatim> test io-12.9 {ReadChars: multibyte chars split} -body { set f [open $path(test1) w] fconfigure $f -translation binary puts -nonewline $f [string repeat a 9]\xC2 close $f set f [open $path(test1)] fconfigure $f -strictencoding 1 -encoding utf-8 -buffersize 10 set in [read $f] read $f close $f scan [string index $in end] %c } -cleanup { catch {close $f} } -result 194 </verbatim></code> This is also incorrect, because [read $chan] is defined to read all characters up until the end of the channel, implying that all data on the channel has been correctly read. The first [read] should return an error. - is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "25. Channel System"
- title changed to:
synchronous [read] with -strictencoding does not produce an error on invalid input
- type changed to: "Bug"