Skip to content
Tcl Source Code Artifact [d00f5117cc]
Login

Artifact [d00f5117cc]

Artifact d00f5117cc86ffe58cd7de9b2418013355bdda46dd28d6260bbe65dbf8dcb1af:

Ticket change [d00f5117cc] - Ticket [b8f575aa2398b0e4|b8f575aa23] <i>Tcl 9: eof erroneously flagged with not reported encoding read error</i> status still Open with 3 other changes by pooryorick on 2023-01-17 16:04:15.
D 2023-01-17T16:04:15.288
J icomment [1a225bd50e984fdc]\sis\sanother\sattempt\sto\sfix\sthe\sissue\sfor\s<code>read</code>:\s\sThe\sreturn\svalue\sis\salways\sthe\scharacters\sthat\shave\sbeen\ssuccessfully\sread,\sand\sin\sthe\scase\sof\san\serror\sthe\serror\sinformation\sis\sfound\sin\sthe\s<code>-errorinfo</code>\sentry\sin\sthe\sreturn\soptions\sdictionary.\s\sThis\sis\sin\scontrast\swith\sthe\searlier\sproposed\sfix,\swhich\sin\sthe\scase\sof\san\serror\splaced\sthe\ssuccessfully-read\scharacters\sin\sthe\s<code>-result\sread</code>\sentry\sin\sthe\sreturn\soptions\sdictionary.\r\n\r\nI\sdon't\ssee\smany\salternatives\sapart\sfrom\sthese\stwo.\s\sOne\sother\salternative\swould\sbe\sto\srestore\sthe\scurrent\saccess\sposition\sin\sthe\sfile\sto\sthe\sposition\sit\swas\sat\sprior\sto\sthe\scall\sto\s<code>read</code>,\sbut\sthere\sare\sso\smany\sdisadvantages\sto\sthis\sthat\sit\sseems\sentirely\sunworkable.\s\sFirst,\sit\swouldn't\swork\sfor\snon-seekable\schannels.\s\sSecond,\sit\sdoesn't\sprovide\saccess\sto\sthe\sposition\sof\sthe\sbad\sbytes.\s\sThird,\sit\sdoesn't\sallow\sthe\scaller\sto\simplement\stheir\sown\shandling\sof\sbad\sparts\sof\sthe\sdata.\s\sFourth,\sit\sdoesn't\sprovide\saccess\sto\sall\sthe\sdata\sdecoded\sup\sto\sthe\serror.\s\sFifth,\sthe\scurrent\sstate\sof\sthe\simplementation\smakes\sit\sdifficult\sto\simplement.\r\n\r\nThe\sother\salternative\sis\sto\schange\sthe\ssemantics\sof\s<code>read</code>\sand\s<code>gets</code>,\sas\sthe\stest\scases\sprovided\swith\sJan's\sproposed\sfix\sdo.\s\sThat\smeans\sthat\sall\scode\sthat\suses\s<code>read</code>\swould\shave\sto\sbe\smodified\sto\sinclude\sa\ssubsequent\scall\sto\s<code>read</code>\sin\sorder\sto\sexpose\sa\slatent\serror.\s\sI\ssee\sthis\sas\sthe\sworst\sof\sthe\spossible\ssolutions,\sand\sprobably\snearly\severyone\swould\sreject\sthis\salternative\s(even\sthough\sit\sis\sthe\sstatus-quo\son\strunk).
J login pooryorick
J mimetype text/x-fossil-wiki
K b8f575aa2398b0e44b5a037326b9d75037e2da4a
U pooryorick
Z f2f4a5676c0080f63d08b1ec3bc8470c