Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Error while twice usage (Trac #2203) #656

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 3 comments
Closed

Runtime Error while twice usage (Trac #2203) #656

numpy-gitbot opened this issue Oct 19, 2012 · 3 comments

Comments

@numpy-gitbot
Copy link

numpy-gitbot commented Oct 19, 2012

Original ticket http://projects.scipy.org/numpy/ticket/2203 on 2012-08-17 by trac user Lukasz16a, assigned to unknown.

The following simple code causes runtime error:

# include <Python.h>
# include <numpy/arrayobject.h>

void f() {
    import_array() ;
}

int main() {
    for(int i=0 ; i<2 ; i++) {
        Py_Initialize() ;
        f() ;
        Py_Finalize() ;
    }
}

The problem is loading numpy.core... I tested it on Visual Studio 2010 at Windows 7 Professional x64.

@charris
Copy link
Member

charris commented Feb 18, 2014

Hmm, looks like a strange construct. I'm inclined to close this unless you can provide a normal example where it fails.

@seberg
Copy link
Member

seberg commented Jan 5, 2019

IIRC it is not expected that import_array can be called twice. We can reopen when someone notes why it should work or has a use case.

@seberg seberg closed this as completed Jan 5, 2019
@mattip
Copy link
Member

mattip commented Jan 5, 2019

This is important for subinterpreters. If PEP 554 gets accepted we may want to revisit this. But it is fine to close this as there are enough other issues open about Py_Finalize,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants