Author glukhov.k
Recipients glukhov.k, paul.moore, steve.dower, tim.golden, zach.ware
Date 2021-07-06.16:21:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2021-07-06 16:21:17glukhov.ksetrecipients: + glukhov.k, paul.moore, tim.golden, zach.ware, steve.dower
2021-07-06 16:21:17glukhov.ksetmessageid: <1625588477.49.0.966107030836.issue44572@roundup.psfhosted.org>
2021-07-06 16:21:17glukhov.klinkissue44572 messages
2021-07-06 16:21:17glukhov.kcreate