Error-handling when stderr is in "strict" profile
Example: <pre> $ tclsh8.7 % fconfigure stderr -profile strict % set env(abc\ud800) can't read "env(abc % </pre> The expected output would be something like: <pre> % set env(abc\ud800) can't read "env(abc\ud800)": no such variable </pre> But, what happens is that \ud800 is an illegal character in the strict profile, so the stderr output is truncated there. At least, the stderr output should indicate what's going on here
b7b93ebbcaMerge [a61dbb7ee6290dd1]: Fix [0df5906dd7]: Error-handling when stderr is in "strict" profile. check-in2024-08-22 17:24:30166b00eb0cFix [0df5906dd7]: Error-handling when stderr is in "strict" profile check-in2023-09-28 18:17:276314825ea9Proposed fix for [0df5906dd7] check-in2023-09-28 15:23:51
Proposed fix [here]
For troubleshooting purposes I think it is important to get as much of the text written out as possible. If all one sees is encoding error in stderr, it is completely unhelpful.
I would propose that stderr use the REPLACE (my preference) or (TCL8) profile even in strict mode.
Of course this can be configured by applications at startup but since it is the preferred behavior in my estimation, it should be made the default (for stderr).
Thanks, Ashok, I was thinking in about the same way. So TIP #657 needs to be modified, adding the "stderr" channel as an exception: "stderr" will be opened "-profile replace" by default (my preference too).
Still, if someone sets "stderr" to strict profile, the channel should do as expected ..... adding *encoding error in stderr* is - at the very least - an improvement over how it is now.
The handling in ::tcl::Bgerror has the same problem.
Fixed by [166b00eb0c]; stderr now also defaults to -profile replace as in TIP 657. Released in 9.0.0.