How to read stdin while debuggingin PythonWin

Mark Hammond MHammond at skippinet.com.au
Sat May 1 01:20:52 EDT 1999


Guido van Rossum wrote in message <5lr9p1a2qg.fsf at eric.cnri.reston.va.us>...
>cmedcoff at my-dejanews.com writes:
>
>> > Im not sure why this would be different under the debugger, but when I
try
>> > that from the Pythonwin window I get:
>> > >>> sys.stdin.read()
>> > Traceback (innermost last):
>> >   File "<interactive input>", line 0, in ?
>> > IOError: [Errno 9] Bad file descriptor
>
>> This is exectly what I observed when aborting the debug process.
>> Any plans to correct this and provide a place for stdin under the
>> debugger.
>
>Mark may not have such plans for PythonWin, but IDLE does fully
>support sys.stdin, whether or not in the IDLE debugger, in a way very
>similar to using the command line python.exe.

he he - I better make Pythonwin support it.

I should clarify:  If you invoke the Pythonwin debugger from a script
running under python.exe or pythonw.exe, then sys.stdin should work fine.  I
definately need to know if this is not true.

Pythonwin.exe however does not setup a valid sys.stdin.  Anything running
under that environment wont work with sys.stdin.  The Pythonwin debugger
should be irrelevant to this.

>Breakpoints seem to be broken on Windows (something to do with
>pathname syntax I'm sure).

I recall jumping those hoops myself.  Cant recall what the changes are, but
I intend examining IDLE in detail soon...

Mark.







More information about the Python-list mailing list