Repository navigation
Conversation
Since psql has been spawned directly through pywinpty (pgadmin-org#10453), it has started with an empty argv[0], because pywinpty passes argv[0] to CreateProcess as the application name but builds the command line from argv[1:] alone. psql then fails with "could not find own program executable". Repeat the executable so that it is also the first word of the command line. Fixes pgadmin-org#10714
|
No actionable comments were generated in the recent review. WalkthroughOn Windows, ChangesWindows PSQL startup
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk:
|
|
Merged as df554c7. |
Fixes #10714.
Since #10453 spawned psql directly through pywinpty instead of via
cmd.exe, psql has started with an emptyargv[0]on Windows and failed withcould not find a "" to executeandcould not find own program executable. pywinpty passesargv[0]toCreateProcessas the application name, but builds the command line fromargv[1:]alone (winpty/ptyprocess.py, the same in 2.0.15 and 3.1.2), so psql never sees its own name. This repeats the executable as the first argument, so that it also leads the command line.The unit test only checks the arguments passed to
spawn, so this still needs a check on Windows that the PSQL tool connects. Whoever does that could also try pywinpty 3.1.2 (#10669) at the same time, watching for psql output only appearing after a keypress, which was the original reason for the 2.0 pin.Summary by CodeRabbit