-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calls to platform._syscmd_ver() dependent functions consume STDIN #88738
Comments
Starting with version 3.9.5 platform.win32* functions have been re-written and consume STDIN. The bug comes down to running 'ver', 'command /c ver', 'cmd /c ver' in platform._syscmd_ver() via subprocess.check_output(). The following code demonstrate the problem: Python\396\python -c "import platform as p, sys;print(sys.stdin.tell());p.win32_ver();print(sys.stdin.tell())" < file All functions dependent on platform._syscmd_ver(), including platform.uname(), consume STDIN. This behavior breaks all the scripts on Windows platform that have the calls mentioned above and use the following invocation: python script.py < file |
The obvious fix is to add "stdin=subprocess.DEVNULL" argument to check_output() call. |
Would you like to create a pull request to that effect? |
I will try |
Well, I opened pull request, but it was closed. You guys have a very good team work going on out there :) Good luck! |
The pull request you opened was invalid, because it was just trying to merge the |
I do not understand why a one line change in the code requires full blown git clone. Shouldn't you guys have a system that allows to change code over the web interface and your bots will do the rest: checks, tests, regressions, etc.? |
You can make a PR entirely through the Github web interface, though we do generally encourage running the tests locally, especially since it would be good to add a new test for this case. |
Thanks for the contribution! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: