Thanks for pointing me in the right direction.
This low-level OS stuff is way out of my comfort zone. It's taken me forever and a lot of googling to work through it but I think I finally have something which can run lame.exe, handles unicode MP3 tags and produces a returncode using
Code:
retcode = win32event.WaitForSingleObject(process_handle, win32event.INFINITE)
I have a few questions:
- Your example in gui2.open_with has the dwCreationFlags parameter set as win32con.CREATE_DEFAULT_ERROR_MODE | win32con.CREATE_NEW_PROCESS_GROUP | win32con.DETACHED_PROCESS.
I think I need DETACHED_PROCESS for my purposes but please could you explain the other two.
- I've just copied your use of 'with sanitize_env_vars()' verbatim without understanding it. Is this OK?
- I didn't even know there were utf-8/non-utf-8 versions of Windows. This new CreateProcess method is working for my Win10 x64 setup but will one-size fit all Windows users.
- I don't think I need to return stdout/stderr for this particular plugin but I may in the future. Please could you give me a a few pointers how to proceed.