Skip to content

add better workaround system for processes when there is no console.#130

Merged
Vizonex merged 1 commit intomainfrom
better-no-console-handler
Apr 10, 2026
Merged

add better workaround system for processes when there is no console.#130
Vizonex merged 1 commit intomainfrom
better-no-console-handler

Conversation

@Vizonex
Copy link
Copy Markdown
Owner

@Vizonex Vizonex commented Apr 10, 2026

What do these changes do?

This change does a better job at providing a workaround when there is no standard stdin, stdout, stderr inputs by checking if _fileno(...) is -2 which is the safest way to perform this, It's better than the old method written around 2 days ago for 0.6.1's release. It is related to #126 but I still refuse to do the full subprocess.py implemenation assuming it would make my pull request to uvloop all that much more difficult which I did not see as being an option unless I'm forced to. Using devnull is a much more reliable choice in which it doesn't become of game of juggling file descriptors around and doesn't use a global variable to determine if there isn't a console (which that can be unreliable if these items were changed by the end user or developer).

Note

If your wondering as to why I'm refusing to write things the way subprocess.py has the fds open and close when items are None is that I have to merge this code back to the uvloop fork I have anyways which is already a pain to resync these up so if your wondering why I'm do not want to do the full setup. There's your reason.

Are there changes in behavior for the user?

Users should now expect less unusual behaviors with pyinstaller and cxfreeze or other exe builders when attempting to launch a subprocess.

Is it a substantial burden for the maintainers to support this?

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@Vizonex Vizonex merged commit 9c4c33a into main Apr 10, 2026
25 checks passed
@Vizonex Vizonex deleted the better-no-console-handler branch April 10, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant