[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-14 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the contribution!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-14 Thread Steve Dower


Steve Dower  added the comment:


New changeset 5fc784e28ab9cd02c30395d1973ff825b787efa2 by Miss Islington (bot) 
in branch '3.9':
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent 
erroneous STDIN consumption (GH-27092)
https://github.com/python/cpython/commit/5fc784e28ab9cd02c30395d1973ff825b787efa2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 425756abdc03263ab3a52b068befd1ddb16c2dd2 by Miss Islington (bot) 
in branch '3.10':
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent 
erroneous STDIN consumption (GH-27092) (GH-27124)
https://github.com/python/cpython/commit/425756abdc03263ab3a52b068befd1ddb16c2dd2


--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +25668
pull_request: https://github.com/python/cpython/pull/27125

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +25667
pull_request: https://github.com/python/cpython/pull/27124

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-13 Thread Steve Dower


Steve Dower  added the comment:


New changeset 0ee0a740e12ec8568aafa033aa6bb08b265afe26 by Konstantin-Glukhov in 
branch 'main':
bpo-44572: On Windows, disconnect STDIN in platform._syscmd_ver() to prevent 
erroneous STDIN consumption (GH-27092)
https://github.com/python/cpython/commit/0ee0a740e12ec8568aafa033aa6bb08b265afe26


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-12 Thread Константин Глухов

Change by Константин Глухов :


--
keywords: +patch
pull_requests: +25640
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/27092

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-07 Thread Zachary Ware


Zachary Ware  added the comment:

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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-07 Thread Константин Глухов

Константин Глухов  added the comment:

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.?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-07 Thread Zachary Ware


Zachary Ware  added the comment:

The pull request you opened was invalid, because it was just trying to merge 
the `main` branch of the python/cpython repository into the `3.9` branch.  What 
we need instead is a pull request between a branch from `main` in your own fork 
of python/cpython with the change you want to see in a new commit.  You can 
find a more detailed walkthrough in the devguide, or if you prefer to leave it 
for someone else to do that is also a valid option :)

--
keywords: +3.9regression -patch
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-07 Thread Константин Глухов

Константин Глухов  added the comment:

Well, I opened pull request, but it was closed. You guys have a very good team 
work going on out there :) Good luck!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-06 Thread Константин Глухов

Change by Константин Глухов :


--
keywords: +patch
pull_requests: +25606
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/27050

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-06 Thread Константин Глухов

Константин Глухов  added the comment:

I will try

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-06 Thread Zachary Ware


Zachary Ware  added the comment:

Would you like to create a pull request to that effect?

--
components:  -IO
stage:  -> needs patch
versions: +Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-06 Thread Константин Глухов

Константин Глухов  added the comment:

The obvious fix is to add "stdin=subprocess.DEVNULL" argument to check_output() 
call.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44572] Calls to platform._syscmd_ver() dependent functions consume STDIN

2021-07-06 Thread Константин Глухов

New submission from Константин Глухов :

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
0
8000

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

--
components: IO, Library (Lib), Windows
messages: 397044
nosy: glukhov.k, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Calls to platform._syscmd_ver() dependent functions consume STDIN
type: behavior
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com