Skip to content

abort when importing modules in Python 2 inside a virtualenv #59

@thanatos

Description

@thanatos

If I attempt to compile a module for Python 2, and import it in a python running out of a virtualenv, I get an abort:

% env/bin/python2 -c 'import _foo'
Fatal Python error: PyThreadState_Get: no current thread
zsh: abort      env/bin/python2 -c 'import _foo'

but the system Python works just fine:

% python2 -c 'import _foo'
%

They should be mostly the same:

% python2
Python 2.7.12 (default, Jun 29 2016, 14:04:44)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
% env/bin/python2
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin

(this is an virtualenv created with virtualenv env; I don't see these issues in Python 3, with a python3 running inside a pyvenv venv virtual environment.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions