Skip to content
Tcl Source Code Artifact [81bac01dd8]
Login

Artifact [81bac01dd8]

Artifact 81bac01dd8719d8047d111b4d77f74cdd7e5b6f045385f91555b8dc9e02bd234:

Manifest of check-in [81bac01dd8] - Fix [91c9bc1c45]: on Windows, [open] failed with an empty error message after dup2() replaced a standard handle behind Tcl's back (e.g. pytest --capture=fd). The new handle from CreateFile() got the value of the closed standard handle, and OpenFileChannel() found the stale std channel by that value; the handle also leaked. Only Tcl_MakeFileChannel() now looks for an existing channel with the same handle. Add [testdup2] and a test. by serhiy.storchaka on 2026-11-12 20:22:51.
B 6e7c8299c536c7e5e086c6af6917161153e857df39f5eddf60e356be8e7b04cd
C Fix\s[91c9bc1c45]:\son\sWindows,\s[open]\sfailed\swith\san\sempty\serror\smessage\safter\sdup2()\sreplaced\sa\sstandard\shandle\sbehind\sTcl's\sback\s(e.g.\spytest\s--capture=fd).\sThe\snew\shandle\sfrom\sCreateFile()\sgot\sthe\svalue\sof\sthe\sclosed\sstandard\shandle,\sand\sOpenFileChannel()\sfound\sthe\sstale\sstd\schannel\sby\sthat\svalue;\sthe\shandle\salso\sleaked.\sOnly\sTcl_MakeFileChannel()\snow\slooks\sfor\san\sexisting\schannel\swith\sthe\ssame\shandle.\sAdd\s[testdup2]\sand\sa\stest.
D 2026-11-12T20:22:51.739
F generic/tclTest.c aff6d0f0ca3db45e33f2d0adcb1a38ff53b598df09c8310a0163371c27351ddd
F tests/io.test ec4ea80724537539610f0a0e6eed31a241053371583d19a72b37bd120ea47b15
F win/tclWinChan.c abf0e06a812d44cf12d1778f348797ad78dcd6611fce3cb5213ca08615bdfab7
P 6e7c8299c536c7e5e086c6af6917161153e857df39f5eddf60e356be8e7b04cd
R e88b6529aeb806ec0ed6b447d1af5b57
T *branch * win-open-stale-handle
T *sym-win-open-stale-handle *
T -sym-main *
T -sym-trunk *
U serhiy.storchaka
Z 98539eb95c5645644465c6d770c2f8f8