This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author oeffner
Recipients oeffner
Date 2013-01-08.13:44:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1357652664.69.0.880454684679.issue16892@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

This is a bug that seems to exist on python 2.7, python 3.3 on Windows versions XP, Vista, 7 and 8 and has been around for some years, presumably also in other python versions. It is only recently I have managed to better isolate it although not completely.

My Windows PC is set up with some doskey macros that are loaded at each
instance of the commandline interpreter cmd.exe with the registry key
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun\mymacros.cmd
Unfortunately this seems to delete stdin when stdin is piped to python scripts that runs another executable invoked with subprocess. In this case the command:

python32 testsubproc.py < mytextfile.txt

will not work. The textfile mytextfile.txt will be ignored. If subprocess is invoked with shell=False the textfile does get piped into stdin. This is however not an option as our porgrams are distributed on other platforms. It would also give an inconsistent experience on the same OS (Windows).

If mymacros.cmd is called interactively from the command prompt the problem does not exist and stdin can be piped into the python script with no problem.

I have attached a working script below which includes a comment section with a small C++ program and the registry key in question to demonstrate the problem.

I would be grateful if there are people who know how to get to the bottom of this bug or even fix it.


Many thanks,


Robert
History
Date User Action Args
2013-01-08 13:44:24oeffnersetrecipients: + oeffner
2013-01-08 13:44:24oeffnersetmessageid: <1357652664.69.0.880454684679.issue16892@psf.upfronthosting.co.za>
2013-01-08 13:44:24oeffnerlinkissue16892 messages
2013-01-08 13:44:23oeffnercreate