Terry J. Reedy <[EMAIL PROTECTED]> added the comment:

When one runs a file with Python30.exe, it opens a window, runs the
file, and closes the window too fast to see what happened.  The point of
the input() statements is to 'pause' execution.  This is standard
debugging along with print()/write() statements.  With three input()s, I
determined that CPython compiled the file, executed the def statement,
and failed the function call (due, I presume, to the requested disk file
not being present).  IDLE, on the other hand, crashed before getting to
the first input() before the function def.  So it crashed while
compiling the file -- or as a result of trying to execute input().

I just tried cut and paste into the IDLE shell window (without the
encoding cookie) and it runs as expected, giving
IOError: [Errno 2] No such file or directory: 'slovnĂ­k.txt'
Retrying with the cookie gives the same.  I have no idea if it is
recognized in interactive mode or if interactive mode is utf8 by default.

I just tried running from a file without the coding line and IDLE
crashed again.  So the problem is reading from a file on Windows.

IDLE is doing *something* different than bare CPython.  Actually, it
uses pythonw30.exe rather that python.exe, but when I replace the input
statements with file write statements (input raises error with pythonw),
pythonw also executed through to the def statement. But I still suspect
something in the interaction between IDLE and pythonw.  There was a
another problem with IDLE and pythonw in .a5
http://bugs.python.org/issue2841 
which seems to have disappeared without being officially fixed.

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2827>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to