Skip to content
Tcl Source Code Artifact [268945fb5d]
Login

Artifact [268945fb5d]

Artifact 268945fb5d6fd07cd5ca190160c1915221c827433d861d889363ce41117ad069:

Ticket change [268945fb5d] - Ticket [b8f575aa2398b0e4|b8f575aa23] <i>Tcl 9: eof errorneously flagged with not reported encoding read error</i> status still Open with 3 other changes by pointsman on 2022-12-09 13:05:54.
D 2022-12-09T13:05:54.179
J icomment Even\sif\sit\sseemed\sclear\sto\sme\sthat\sdespite\sof\s-strictencoding\strue\s-nocomplainencoding\sfalse\sneither\sthe\s[read]\sitself\snor\s[eof]\sgiving\sno\ssign\sof\serror\scould\snot\sreally\sbe\show\sthis\sis\ssupposed\sto\swork\s--\sI\shave\sto\sconfess\sthat\sI\shaven't\sa\sclear\spicture\sabout\show\sthis\sin\sfact\sis\ssupposed\sto\swork.\r\n\r\nMay\sI\sask:\sSince\sI\sgave\s-strictencoding\strue\s-nocomplainencoding\sfalse\s-\sthat\sis,\sI\smade\sclear\sthat\sI\swanted\sto\sbe\sinformed\sabout\sencoding\serrors\s-\swhy\sdoesn't\sthe\sfirst\s[read]\sraised\serror\sin\sthe\sfirst\splace?\r\n\r\nIt\sis\strue\sthat\simmediately\sraising\serror\satm\sdoesn't\sprovide\sinformation\sabout\swhere\sin\sthe\sinput\sthe\serror\sis\s(byte\sor\schar\sposition).\sOr\sdid\sI\shave\smissed\ssomething\shere?\r\n\r\nBut\seven\sif\sthe\sbehaviour\sis\schanged\sso\sthat\s[eof]\sreturns\s0\sto\ssignal\sthat\ssomething\shappend\s(as\sproposed\shere)\sthat\swould\smean\sthat\sI\sneed\sa\scombination\sof\swhile\s{![eof]}\s{}\sand\sa\scatch/try\saround\sthe\s[read],\ssomething\slike\r\n\r\n```\r\nfd\s[open\s"somefile"]\r\nset\sdata\s""\r\nwhile\s{![eof\s$fd]}\s{\r\n\s\sif\s{[catch\s{append\sdata\s[read\s$fd]}]}\s{\r\n\s\s\s\s#\sHandle\serror\r\n\s\s}\r\n}\r\n```\r\n\r\nIt's\sthis\show\sthis\sis\ssupposed\sto\swork.\s\r\n\r\nIsn't\sthis\sa\sbit\sawkwarded\s/\sconvoluted?\sEspecially\sgiven\sthat\smost\sprogrammers\sare\stypically\sdon't\sexpect\sto\shave\sto\scheck\s[eof]\sif\sthey\swant\sto\sread\sthe\swhole\sdata\sout\sof\sa\sfile\sin\sone\sgo\swith\s[read\s$fd].
J login pointsman
J mimetype text/x-markdown
K b8f575aa2398b0e44b5a037326b9d75037e2da4a
U pointsman
Z 24bdebbbf1f10b9ffc8bad71a1ea5318