[Idle-dev] Python Core Dump

Kurt B. Kaiser kbk at shore.net
Tue Nov 22 22:26:52 CET 2005

Fuzzyman <fuzzyman at voidspace.org.uk> writes:

> I tried the test you suggest above, with interesting results.
> I edited ``EditorWindow._find_module`` with 7 print statements. Edited
> code shown below  :
> def _find_module(fullname, path=None):
>     """Version of imp.find_module() that handles hierarchical module
> names"""
>     print 'fullname', fullname
>     file = None
>     for tgt in fullname.split('.'):
>         if file is not None:
>             file.close()            # close intermediate files
>         print 'tgt', tgt
>         (file, filename, descr) = imp.find_module(tgt, path)
>         print 'filename', filename
>         print 'descr', descr
>         if descr[2] == imp.PY_SOURCE:
>             break                   # find but not load the source file
>         module = imp.load_module(tgt, file, filename, descr)
>         print 'Got here', module
>         try:
>             path = module.__path__
>         except AttributeError:
>             print 'Got here too.'
>             raise ImportError, 'No source for module ' + module.__name__
>     print 'Got here three ??'
>     return file, filename, descr
> I then ran IDLE from the command line, and did "open module ->
> operator". You can see the results of the print statements below. The
> crash happens after the ImportError is raised... hmm.. maybe I should
> have tried patching ``EditorWindow.open_module`` as well, I didn't see
> that suggestion until now.
> Anyway - *after* the crash a traceback from Tkinter is printed to the
> console. This is part of an rpc call. Whether it will make any sense to
> you is another matter. :-)
> C:\Program Files\Windows Resource Kits\Tools>python
> C:\Python24\Lib\idlelib\idle.pyw
> fullname operator
> tgt operator
> filename operator
> descr ('', '', 6)
> Got here <module 'operator' (built-in)>
> Got here too.
> Exception in Tkinter callback
> Traceback (most recent call last):
>   File "C:\Python24\lib\lib-tk\Tkinter.py", line 1345, in __call__
>     return self.func(*args)
>   File "C:\Python24\lib\lib-tk\Tkinter.py", line 456, in callit
>     func(*args)
>   File "C:\Python24\lib\idlelib\PyShell.py", line 493, in poll_subprocess
>     response = clt.pollresponse(self.active_seq, wait=0.05)
>   File "C:\Python24\lib\idlelib\rpc.py", line 421, in pollresponse
>     message = self.pollmessage(wait)
>   File "C:\Python24\lib\idlelib\rpc.py", line 373, in pollmessage
>     packet = self.pollpacket(wait)
>   File "C:\Python24\lib\idlelib\rpc.py", line 344, in pollpacket
>     r, w, x = select.select([self.sock.fileno()], [], [], wait)
> error: (10093, 'Either the application has not called WSAStartup, or
> WSAStartup
> failed')

The rpc.py module is part of IDLE, but that's an error I haven't seen
before.  No new sockets are created while the subprocess is running.
Is there any indication that the subprocess died? (Check your process
manager, does the number of Python processes change after the crash?)

Is this Exception reproducible? How long after the crash does it
appear?  Are there any other symptoms to the crash?

I gather you never see 'WSAStartup failed' except in this case.

Is "Got here too." always printed?  Does the ImportError always appear?
Does the crash occur before or after clicking "OK" on the exception

If after, then instrument EditorWindow.open_module() to see how far it
gets after _find_module() returns, and whether that's reproducible.


More information about the IDLE-dev mailing list