From: Ashok N. <apn...@ya...> - 2025-04-28 12:34:30
|
Jan, You always have our attention but I am not sure about the converse! I already commented on your test cases in Re: [TCLCORE] TIP 716 ready for comments | Tcl<https://sourceforge.net/p/tcl/mailman/message/59173666/> and how they needed to be written. Your response was that you were still experimenting. In any case, I have fixed your failing chmod tests. TL;DR use wide character API's to avoid these exact issues. In particular, from the TIP (emphasized in the TIP itself): For compatibility reasons, the Tcl_GetEncodingNameForUser function will not be public via stubs in 9.0.2 but will be public in 9.1. Further attempts to clarify my preference for 716, as much as I have to hold my nose when proposing it ... There are four transfer points at which encodings matter. Tcl core <-> Tcl extensions <->third party DLL's<->external applications. In Tcl 8.6, all was hunky dory because all above components agreed on the encodings [encoding system] == Tcl.GetACP() == OtherProcess.GetACP() (i.e. User's encoding in registry). Both Tcl 9 and TIP 716 break this in slightly different ways. In Tcl 9, [encoding system] == Tcl.GetACP() == utf-8 (within the Tcl process only!) but Tcl.GetACP() != OtherProcess.GetACP(). This causes two forms of breakage. First, because Tcl.GetAcp() != OtherProcess.GetACP(), transfers to other applications breaks (e.g. Piping to Windows command line programs, database servers etc.). Second, because Tcl.GetACP() == utf8 applies to shared libraries, this breaks shared libraries that cannot handle UTF-8, e.g. GDI etc. (By shared libraries, I don't mean Tcl extensions but DLL's linked to Tcl or extensions that know nothing about Tcl.) TIP 716 chooses a different mode of breakage! [encoding system] == utf-8 (bad idea imo but required for Tcl 9 compatibility w.r.t. default channel encodings), BUT [encoding system] != Tcl.GetACP() and instead Tcl.GetACP() == OtherProcess.GetACP(). Neither Tcl 9.0 nor 716 are optimal, unlike 8.6. Why then do I prefer 716? Because with 716 the breaking points can be fixed within Tcl and Tcl extension code by switching to wide character API's or using Tcl encoding API's. It's all code within the control of the extension writer. My changes to your test cases above fall into this category. On the other hand, Tcl 9.0 behavior has the potential for issues like DB2 where the extension writer has *no recourse* other than his own tclsh build with the manifest removed. That in turn immediately makes the "modified" tclsh incompatible with "stock" tclsh (files written on the same system by one will be unreadable by the other) which is not a desirable thing. I would seriously consider withdrawing 716 if you can figure out how to fix the DB 2 kind of issue. /Ashok ________________________________ From: Jan Nijtmans Sent: Monday, April 28, 2025 12:45 PM To: Harald Oehlmann Cc: tcl...@li... Subject: Re: [TCLCORE] TIP 716 ready for comments Op vr 25 apr 2025 om 19:37 schreef Harald Oehlmann: > P.S. I have retried my test with the updated branch. This does not make > any difference (and should IMHO not). The result is ok and now, we have > migration text ;-). 1) So, did you see the following test failures? 2) Does TIP #716 tell anything about this? Hope I have your attention now ;-) Jan NIjtmans P.S.: Github ACTIONS shows the same failure: <https://github.com/tcltk/tcl/actions/runs/14635843756/job/41066664724> 109==== cmdAH-16.2 Tcl_FileObjCmd: readable FAILED 110==== Contents of test case: 111file readable $gorpfile 112---- Test setup failed: 113D:\a\tcl\tcl\win\górp.file: no such file or directory 114---- errorInfo(setup): D:\a\tcl\tcl\win\górp.file: no such file or directory 115 while executing 116"testchmod 0o444 $gorpfile" 117 ("uplevel" body line 1) 118 invoked from within 119"uplevel 1 $setup" 120---- errorCode(setup): POSIX ENOENT {no such file or directory} 121==== cmdAH-16.2 FAILED 122 123 124 125==== cmdAH-17.2 Tcl_FileObjCmd: writable FAILED 126==== Contents of test case: 127file writable $gorpfile 128---- Test setup failed: 129D:\a\tcl\tcl\win\górp.file: no such file or directory 130---- errorInfo(setup): D:\a\tcl\tcl\win\górp.file: no such file or directory 131 while executing 132"testchmod 0o555 $gorpfile" 133 ("uplevel" body line 1) 134 invoked from within 135"uplevel 1 $setup" 136---- errorCode(setup): POSIX ENOENT {no such file or directory} 137==== cmdAH-17.2 FAILED 138 139 140 141==== cmdAH-17.3 Tcl_FileObjCmd: writable FAILED 142==== Contents of test case: 143file writable $gorpfile 144---- Test setup failed: 145D:\a\tcl\tcl\win\górp.file: no such file or directory 146---- errorInfo(setup): D:\a\tcl\tcl\win\górp.file: no such file or directory 147 while executing 148"testchmod 0o222 $gorpfile" 149 ("uplevel" body line 1) 150 invoked from within 151"uplevel 1 $setup" 152---- errorCode(setup): POSIX ENOENT {no such file or directory} 153==== cmdAH-17.3 FAILED 154 155cmdIL.test _______________________________________________ Tcl-Core mailing list Tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcl-core |