Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2023-05-04
13:04 • Ticket [5338d8e82f] Closing the std* channels and opening replacements sometimes... artifact: e4c3ae689d user: cyan
13:02 • New ticket [5338d8e82f]. artifact: 2932584dfb user: cyan

Closing the std* channels and opening replacements sometimes doesn't register the std* channel name in interps

Open5338d8e82fb3e23658b61bb60ea82cdd2d581c61Created 4 years agoUpdated 4 years ago
Descriptionplain2023-05-04 13:02:25
In the following code, if stdout was written to by the parent interp before closing
then it will fail on the line that configures the (new) stdout channel with the error:

can not find channel named "stdout"

If the first line that outputs to stdout in the parent interp is commented out, the code
works as expected:

interp create foo
puts "before, parent"   ;# Works if this line is commented out
interp eval foo {puts stderr "before, child"}
interp eval foo {close stdout}
interp eval foo [list open [exec tty] w]
interp eval foo {chan configure stdout -buffering line -blocking 0}
puts "New stdout, from parent"
interp eval foo {puts "New stdout, from child"}
cyan Ticket [5338d8e82f]: 3 changes [History diff]2023-05-04 13:04:21
Log in (anonymous is fine) to add a comment.