Repository navigation
Commit 6023cac
authored
The launcher links the C runtime statically, so its startup code sets the app
type only in its own copy. Python, loaded in-process through python3.dll, uses
the shared UCRT, whose app type stays unknown. The UCRT then doesn't update the
process's standard handles when Python swaps fds 0-2 with os.dup2 (as pytest's
fd capture does), GetStdHandle keeps returning a closed handle, and a subprocess
that inherits stdin fails with WinError 6.
Set it to console (or GUI for the windowed launcher) before calling Py_Main, as
python.exe's own startup would.
1 parent 791e4d7 commit 6023cac
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
252 | 256 | | |
253 | 257 | | |
254 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
255 | 275 | | |
256 | 276 | | |
257 | 277 | | |
| |||
0 commit comments