Python2.4 on Win32 suddenly started crashing last night
Tim Chase
python.list at tim.thechases.com
Thu Sep 13 09:08:10 EDT 2012
On 09/13/12 07:42, Tim Chase wrote:
> It was working as of last night, and to the best of my knowledge,
> nothing was changed on the system. It took a while to track it
> down, but it came from importing smtplib which in turn imports socket.
>
> I've tried "import socket" and it crashes, but then tried importing
> each of the modules that are imported in socket.py and nothing dies:
>
> C:\Program Files\Python24\Lib>python
> Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import _socket
>>>> from _socket import *
>>>> import _ssl
>>>> from _ssl import *
>>>> import os, sys
>>>> from errno import EBADF
>>>> sys.platform
> 'win32'
>>>> import socket
> [win32 crash happens here]
Further diagnostics (copying socket.py to suckit.py and adding a
sys.exit(1) at various points and then importing sucket) seem to
point to this line in socket.py:
__all__.extend(os._get_exports_list(_socket))
So I can reduce the case to
>>> import _socket
>>> import os
>>> os._get_exports_list(_socket)
and it goes kablooie. If I do the same with _ssl:
>>> import _ssl
>>> import os
>>> os._get_exports_list(_ssl)
and it works fine.
-tkc
More information about the Python-list
mailing list