Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7ff07324bdadebd242a659b255b507fea9b53782e3910b48e1762b4f6295762a
Ticket: da63e4c1efcfc3e68fdc4527df6a8109e1eac348
Crash in Tcl_WriteChars()
User & Date: jan.nijtmans on 2022-11-23 15:34:14
Changes

  1. icomment:
    First attempt for a fix [58883dde6de7f4a8|here].
    
    Although the fix works, it shows that TIP #601 (about making encoding errors thowing exceptions) was not implemented throughout yet. For example, testcase io-1.6 does the following:
    <pre>
        fconfigure $f -encoding binary
        puts -nonewline $f "a乍\x00"
    </pre>
    This is illegal, because the "binary" encoding only accepts bytes while 乍 is not a byte at all. With TIP #601, I expect this test-case to throw an exception. The solution [58883dde6de7f4a8] does this by generating this exception when converting the string to a bytearray.
    
    What would be even better, is when "puts" would write the bytes to the channel up to the error-character (so, just 'a' in this case), and then throw the exception. That part is not done yet in this first attempt.
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/x-fossil-wiki"