Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Sync fcopy buffers input in ReadChars()

Closed / Fixed9ca87e6286262a62f379dde23604535b0b2dc1d6Created 4 years agoUpdated 3 years ago
Descriptionwiki2023-04-03 16:32:22
In [4a7397e0b3] it was reported that sync fcopy buffers input, but the example provided was only for the ReadBytes() case, and only that branch in the code was fixed. The following script shows that the issue still exists for the ReadChars() branch, waiting forever for read() to return:

file delete $path(output)
set f1 [open $path(output) w]
puts -nonewline $f1 {
    chan configure stdin -encoding iso8859-1 -translation lf -buffering none
    fcopy stdin stdout
}
close $f1
set f1 [open "|[list [info nameofexecutable] $path(output)]" r+]
try {
    chan configure $f1  -buffering none
    puts -nonewline $f1 A
    set ch [read $f1 1]
} finally {
    if {$f1 in [chan names]} {
	close $f1
    }
}
lindex $ch
Referenced by1
  • a1e8dc4f04Ticket [3096275fff] Sync fcopy buffers input status still Closed with 7 other changes ticket2023-04-03 18:16:19
pooryorickwiki2023-04-03 17:15:01

Failing test in [44d3129b05b73a76]. Fixed in [e08c4afb5351744e].

jan.nijtmanswiki2023-04-04 08:32:44

Thanks for the fix!

The fix was only committed to trunk, but it should be done in core-8-branch too. Am I right?

pooryorickwiki2023-04-04 16:27:16

Yes, fixed for core-8-branch in [ab027cdce4].

jan.nijtmans Closed ticket [9ca87e6286]. [History diff]2023-09-12 13:10:50
Log in (anonymous is fine) to add a comment.