raw_input bug only in cygwin python
David Carson
davidccarson at hotmail.com
Thu Apr 18 23:07:55 EDT 2002
Here is a snippet of code:
01: #!/usr/bin/env python
02:
03: list = []
04: while 1:
05: try:
06: stuff = raw_input("[^D to exit]: ")
07: except EOFError:
08: print "got EOF"
09: break
10: list.append(stuff)
11:
12: raw_input("bang! ")
This works on every Python environment I've tried but cygwin (Win2000
-- I haven't got NT to try it):
Python 2.2 (#1, Dec 31 2001, 15:21:18)
[GCC 2.95.3-5 (cygwin special)] on cygwin
In this environment, the EOFError is caught. Then the "bang! " prompt
for the raw_input() outside the loop is printed, but immediately the
program exits with an uncaught EOFError.
This code works with:
- ActiveState Python, 2.1 on Win2000
- python 2.2 on Mandrake
- python 1.5.2 on RedHat
and everywhere else, I'm sure.
Is this a known problem with cygwin?
Cheers,
David
More information about the Python-list
mailing list