#5726 defect new
spawnProcess opens an unwanted console
|Reported by:||Alejandro J. Cura||Owned by:||Alejandro J. Cura|
|Cc:||Allister MacLeod, Jean-Paul Calderone||Branch:||
branch-diff, diff-cov, branch-cov, buildbot
When spawning a process under Windows to capture its standard output, if the controlling process is not a console application a new console is wrongly opened.
Here's a sample program that shows the bug:
# should_not_open_console.pyw from twisted.internet import reactor, utils def write_result(result): open("output.log", "w").write(repr(result)) reactor.stop() PING_EXE = r"c:\windows\system32\ping.exe" d = utils.getProcessOutput(PING_EXE, ["slashdot.org"]) d.addCallbacks(write_result) reactor.run()
Make sure to run it with the pythonw executable:
When running the above command, the program starts in the background, and the wrong behavior shows up: a new console is opened, with the path to ping.exe as the title, and it remains blank while ping runs.
The expected behavior is: no new console is opened.
Change History (18)
comment:4 Changed 5 years ago by
|Keywords:||windows, console, review → windows console review|
|Summary:||[windows] spawnProcess opens an unwanted console → spawnProcess opens an unwanted console|
comment:7 Changed 5 years ago by
|Owner:||changed from Allister MacLeod to Alejandro J. Cura|
comment:11 Changed 4 years ago by