[Python-bugs-list] [Bug #112944] Second import of module succeeds even if first import failed

noreply@sourceforge.net noreply@sourceforge.net
Mon, 28 Aug 2000 09:03:04 -0700


Bug #112944, was updated on 2000-Aug-28 09:03
Here is a current snapshot of the bug.

Project: Python
Category: Modules
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: Second import of module succeeds even if first import failed

Details: The second import of a library that failed the first time does not re-initialize the module, and returns a reference to the uninitialized module:

>>> import cPickle
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named copy_reg
>>> ^P
  File "<stdin>", line 1
    
    ^
SyntaxError: invalid syntax
>>> import cPickle
>>> 

Subsequent use of the uninitialized module crashes the interpreter:

>>> cPickle.Pickler()
Segmentation fault (core dumped)

(and it happens the same way in scripts.)


For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=112944&group_id=5470