stdin broken on Win2K?

David Bolen db3l at fitlinxx.com
Fri Sep 28 20:28:12 EDT 2001


Dale Strickland-Clark <dale at riverhall.NOSPAMco.uk> writes:

> This:
> 
> # stdintest.py
> # Copy stdin to stdout
> 
> import sys
> l = sys.stdin.readline()
> while l:
> 	print l,
> 	l = sys.stdin.readline()
> 
> 
> doesn' work from the Win2K command prompt in either of the following
> cases:
> 
> stdintest <source.txt
> type source.txt | stdintest
> 
> However, if you don't redirect stdin, it will happily reflect console
> input to the console.

At least NT has a bug in CMD.EXE when using automatic execution of
Python scripts via the PATHEXT variable and command line redirection.
Perhaps it's still present in Win2K's CMD.EXE.

What happens if you use "python stdintest.py" rather than just
"stdintest" in your command?

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list