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
Can't pipe input to a python program #40792
Comments
Details in attached file. Basically, I want to be Thanks.
[Please reply to rivest@mit.edu as well...] |
Logged In: YES What shell is this in? I cannot reproduce this in a cmd.exe Can you please add print sys.stdin.fileno() into the script? On my system, it gives "0". |
Logged In: YES If I print out sys.stdin.fileno(), I get -1 . Thanks...
|
Logged In: YES I see the same on my Win XP Pro SP1 box, but I expected "STDIN/STDOUT Redirection May Not Work If Started from a http://support.microsoft.com/default.aspx?kbid=321788 It works fine if you change the "eggs.py" part of your \python23\python.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 and then
works fine. The point is that it doesn't work if Python gets Since this has nothing to do with Python (same thing if you BTW, the KB article above claims the problem was fixed in XP You could also use Cygwin on Windows, whose default bash Martin, it's sure curious that it works for you! My ver output I'll note that I get one more line of output than Ron reported C:\Code\python\PCbuild>type tcap.txt | eggs.py
The process tried to write to a nonexistent pipe.
Traceback (most recent call last):
File "C:\Code\python\PCbuild\eggs.py", line 4, in ?
text = sys.stdin.read()
IOError: [Errno 9] Bad file descriptor |
Logged In: YES Thanks to tim_one! Your analysis of the situation does seem correct, and I agree that the "3rd Pary; Won't Fix" designation is Thanks again!
|
Logged In: YES It worked for me since I didn't reproduce Ron's actions type spam.txt | \python23\python.exe eggs.py since on that system, I had deleted the .py extension, so |
Logged In: YES Ah, that would explain it <wink>. It's still curious that the KB |
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: