New submission from Константин Глухов <glukho...@gmail.com>:

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 <rep...@bugs.python.org>
<https://bugs.python.org/issue44572>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to