[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window

2020-08-23 Thread Eryk Sun
Eryk Sun added the comment: I suppose that, in addition to fixing the bug with si.dwFlags, code could be added to use DETACHED_PROCESS if GetConsoleCP() returns 0 (i.e. the launcher isn't attached to a console). -- ___ Python tracker

[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window

2020-08-23 Thread Paul Moore
Paul Moore added the comment: Confirmed, CREATE_NO_WINDOW works - in my test I used it *with* DETACHED_PROCESS. Is it not a bug that the launcher doesn't respect the value of DETACHED_PROCESS when calling the Python interpreter, though? If nothing else, it means that there are differences

[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window

2020-08-23 Thread Eryk Sun
Eryk Sun added the comment: Creating the py.exe process with creationflags=DETACHED_PROCESS sets a special ConsoleHandle value in its ProcessParameters that makes the base API skip allocating a console session at process startup. However, the launcher itself spawns python.exe normally,

[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window

2020-08-23 Thread Bernat Gabor
Change by Bernat Gabor : -- nosy: +Bernat Gabor ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window

2020-08-23 Thread Paul Moore
Paul Moore added the comment: Originally discovered in https://github.com/pypa/virtualenv/issues/1928 - see that issue for more context. -- ___ Python tracker ___

[issue41619] Subprocesses created with DETACHED_PROCESS can pop up a console window

2020-08-23 Thread Paul Moore
New submission from Paul Moore : The following code pops up an extra console window when run on Windows 10, Python 3.8: from subprocess import DETACHED_PROCESS, Popen p = Popen(["py", "-c", "from time import sleep; sleep(5)"], creationflags=DETACHED_PROCESS) Adding CREATE_NO_WINDOW