Skip to content
Tcl Source Code Artifact [b5517f5a57]
Login

Artifact [b5517f5a57]

Artifact b5517f5a578ca95ad71e04ed0debfe5b67235545fa4d5da05cf2c8efce112888:

Ticket change [b5517f5a57] - New ticket [dc23c6419310c5f4|dc23c64193] <i>[read] fails, on encoding error, but current position advances anyway.</i>. by pooryorick on 2023-04-08 11:26:50.
D 2023-04-08T11:26:50.787
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment Given\sthe\sfollowing\sscript,\r\n\r\n<blockquote><code><verbatim>\r\nset\schan\s[file\stempfile]\r\nchan\sconfigure\s$chan\s-translation\sbinary\s-profile\sstrict\r\nputs\s-nonewline\s$chan\shello\\xc0there\r\nchan\sconfigure\s$chan\s-encoding\sutf-8\s-profile\sstrict\r\nseek\s$chan\s0\r\ncatch\s{read\s$chan}\serrmsg\r\nchan\stell\s$chan\s;#\s->\s5\r\n</verbatim></code></blockquote>\r\n\r\n\r\n,\sthere\sis\san\sinvalid\sutf-8\ssequence\sstarting\sat\sposition\s5.\s<code>read</code>\r\nproduces\san\serror\sand\s<code>chan\stell</code>\sreport\sthat\sthe\scurrent\sposition\r\nin\sthe\sfile\shas\sadvanced\sto\sbyte\s<code>5</code>.\s\sBecause\sthe\sposition\shas\r\nadvanced,\sif\sthe\schannel\sis\snot\sseekable,\sthere\sis\sno\sway\sto\sadjust\sthe\schannel\r\nconfiguration\sand\stry\sagain.\r\n\r\nOn\ssuch\sa\sfailure,\seither\sthe\sposition\sin\sthe\sfile\sshould\sremain\swhat\sit\swas\r\nbefore\sthe\sunsuccessful\sread,\sor\sthe\sresult\sup\sto\sbyte\s5\sshould\sbe\smade\r\navailable\sto\sthe\scaller.
J is_private 0
J login pooryorick
J priority 5\sMedium
J private_contact 2b2275eab1118e1fab0016cf1c5702893c6af86c
J resolution None
J severity Minor
J status Open
J submitter pooryorick
J subsystem -\sNew\sBuiltin\sCommands
J title [read]\sfails,\son\sencoding\serror,\sbut\scurrent\sposition\sadvances\sanyway.
J type Bug
K dc23c6419310c5f4d1d08c8681773e482e7a43b1
U pooryorick
Z 83209e5bb891f0e898be81800a781db9