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
reload() is broken for C extension objects #41601
Comments
import foo
foo = reload(foo) The reload() method calls imp.load_dynamic() which This problem can be fixed by augmenting imp with |
Logged In: YES I don't believe this is quite as easy as you make out. It might be |
Logged In: YES I am only interested in fixing it for the dlopen() case, |
Logged In: YES I have coded the proposed solution (changed import.c, |
Logged In: YES I don't know if this is a viable general-purpose fix. Keep in
... imaginary recompile ... >>> reload(select)
<module 'select' from 'C:\Python24\DLLs\select.pyd'>
>>> b = select.select
>>> id(a)
18165472
>>> id(b)
18165476
>>> a() #BOOM! |
I agree with Grant. There seems to be no way this can be sanely |
This may be crazy but +20 years later I am facing the same issue, and as of python 3.9 the issue still exists. Is there still no reliable way to re-import a compiled python module? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: