raw_input with MSVC Python under cygwin

John J Lee jjl at pobox.com
Mon Dec 2 13:51:22 EST 2002


When using the MSVC-compiled Python (any version, I think, but
certainly 2.2, which is what I'm using now) under cygwin+bash, the
first time raw_input gets used in a script appears to be ignored.
I've tried flushing sys.stdin, and that makes no difference.

This 'cures' it:

CYGWIN = False
# If you're using cygwin's bash shell and the MSVC Python, uncomment
# the following line
#CYGWIN = True
if CYGWIN:
    # for some reason, cygwin+bash ignores the first raw_input
    raw_input()
[can happily use raw_input normally from here onwards]

Is this a known issue?  Is there a fix, or a better work-around?

BTW, is there any programmatic hack to figure out if you're being run
under cygwin/bash?


John



More information about the Python-list mailing list