Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-22
17:19 • Ticket [0df5906dd7] Error-handling when stderr is in "strict" profile<... artifact: 7d7a05ed53 user: serhiy.storchaka
2026-10-15
11:39 • Closed ticket [0df5906dd7]. artifact: 63b46ed7b1 user: serhiy.storchaka
2024-08-22
17:24
Merge [a61dbb7ee6290dd1]: Fix [0df5906dd7]: Error-handling when stderr is in "strict" profile. check-in: b7b93ebbca user: pooryorick tags: unchained, INCOMPATIBLE_LICENSE
2023-09-28
18:20 • Pending ticket [0df5906dd7]: Error-handling when stderr is in "strict"... artifact: da9195e9cb user: jan.nijtmans
18:17
Fix [0df5906dd7]: Error-handling when stderr is in "strict" profile check-in: 166b00eb0c user: jan.nijtmans tags: core-8-branch
18:16 • Ticket [0df5906dd7] Error-handling when stderr is in "strict" profile<... artifact: efc178f187 user: jan.nijtmans
16:25 • Ticket [0df5906dd7]: 3 changes artifact: babe275893 user: apnadkarni
15:26 • Ticket [0df5906dd7]: 3 changes artifact: 272d180a0f user: jan.nijtmans
15:23
Proposed fix for [0df5906dd7] check-in: 6314825ea9 user: jan.nijtmans tags: bug-0df5906dd7
15:18 • New ticket [0df5906dd7] Error-handling when stderr is in "strict" prof... artifact: ffa0e55ca1 user: jan.nijtmans

Error-handling when stderr is in "strict" profile

Closed / Fixed0df5906dd7e4beb33712ed51437ebb4369c3c101Created 3 years agoUpdated 41 days ago
Descriptionplain2023-09-28 15:18:56
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
Referenced by3
jan.nijtmanswiki2023-09-28 15:26:36

Proposed fix [here]

apnadkarnimarkdown2023-09-28 16:25:13

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).

jan.nijtmanswiki2023-09-28 18:16:55

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.

jan.nijtmans Pending ticket [0df5906dd7]. [History diff]2023-09-28 18:20:42
serhiy.storchakawiki2026-10-15 11:39:51

Fixed by [166b00eb0c]; stderr now also defaults to -profile replace as in TIP 657. Released in 9.0.0.

serhiy.storchaka Ticket [0df5906dd7]: 3 changes [History diff]2026-10-22 17:19:26
Log in (anonymous is fine) to add a comment.