Eric Snow added the comment:

Here's the deal.  import_module_level() gets called for v1 from sa (where 
"globals" comes from). In that function it first calls get_parent(), which 
returns a borrowed reference to the sa module object. Then that parent object 
is passed to load_next() where the actual load of v1 will take place (and the 
segfault happens).

The problem is that get_parent() returns a borrowed reference.  When the sa 
module is replaced in sys.modules, the old sa module is decref'ed.  That's fine 
except load_next is using that same module as the parent.  Enter segfault, 
stage left.

Here's a quick patch that fixes the failure (along with a test).

----------
keywords: +patch
nosy: +brett.cannon, eric.snow
stage:  -> patch review
Added file: http://bugs.python.org/file26883/eric.snow_issue15578.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15578>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to