On Windows every call of GLib.spawn_asyn(...) starts not just the subprocess but a new console window too. On Linux it's not doing this. Am I missing something or is this a known bug?
I'v read gspawn*.c sources and the conclusion is that GLib has no functionality on Windows(Linux is ok) what we need in PyChess. PyChess is a chess GUI program spawning chess engines (console programs!) to play/analyze with, but don't need console windows of child processes (chess engines) at all, just stdin/stdout/stderr to communicate with them.
It's pending from 2008: https://bugzilla.gnome.org/show_bug.cgi?id=509201
The latest patch attached to the issue by Alexander Shaduri seems the way to go. Unfortunately not commented by upstream :(
Consider to add that patch to pygobjctwin32, please!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the link, I will think about it for the next rev22. I used to simply overwrite gspawn-win32-helper-console.exe with gspawn-win32-helper.exe when encounter such case.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
AttributeError: 'gi.repository.GLib' object has no attribute 'SPAWN_WIN32_HIDDEN_CONSOLE'
To let it work, the patch needs an additional change. It has to add 'WIN32_HIDDEN_CONSOLE' into the SPAWN flags list in gi\overrides\GLib.py in line#505.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I see, well it's supposedly introspected without SPAWN prefix and in lowercase I don't know it been overrided. Sorry but I won't make revision just for that, not without other updates at least.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You meant the spawner window?
There is two spawner: gspawn-win32-helper.exe and gspawn-win32-helper-console.exe, the former don't show window
Sorry, but how can I influence in my python code which one will be used by GLib.spawn_async()? I find nothing about this in documentation.
BTW, please consult gspwn documentation, especially windows section. At any rate this should reported upstream.
I'v read this https://lazka.github.io/pgi-docs/#GLib-2.0/functions.html#GLib.spawn_async
but find nothing.
I'v read gspawn*.c sources and the conclusion is that GLib has no functionality on Windows(Linux is ok) what we need in PyChess. PyChess is a chess GUI program spawning chess engines (console programs!) to play/analyze with, but don't need console windows of child processes (chess engines) at all, just stdin/stdout/stderr to communicate with them.
It's pending from 2008: https://bugzilla.gnome.org/show_bug.cgi?id=509201
The latest patch attached to the issue by Alexander Shaduri seems the way to go. Unfortunately not commented by upstream :(
Consider to add that patch to pygobjctwin32, please!
Thanks for the link, I will think about it for the next rev22. I used to simply overwrite gspawn-win32-helper-console.exe with gspawn-win32-helper.exe when encounter such case.
Unfortunately it doesn't help in our case. It doesn't force the actual started process to not open console window.
First test with rev22 produced:
AttributeError: 'gi.repository.GLib' object has no attribute 'SPAWN_WIN32_HIDDEN_CONSOLE'
To let it work, the patch needs an additional change. It has to add 'WIN32_HIDDEN_CONSOLE' into the SPAWN flags list in gi\overrides\GLib.py in line#505.
I see, well it's supposedly introspected without SPAWN prefix and in lowercase I don't know it been overrided. Sorry but I won't make revision just for that, not without other updates at least.
No problem I'm ok with rev22. It's in a .py file, so I can fix it easily myself for PyChess. Thx for adding the patch!
Last edit: Bajusz Tamás 2015-09-09