Ticket #5726 defect new
spawnProcess opens an unwanted console
|Reported by:||alecu||Owned by:||alecu|
(diff, github, buildbot, log)
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.