-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Improve errors related to frozen modules. #89542
Comments
In Python/import.c there are various situations in which an error state related to frozen modules might result and even lead to an exception. In #72819 we consolidated these cases into a new "frozen_status" enum and added "set_frozen_error()" to set a consistent exception based on a status. There are several deficiencies to address at this point:
[1] #28633 (comment) |
I was looking at the code and it seems PyImport_ImportFrozenModuleObject does not set an error on FROZEN_BAD_NAME, it just returns 0, is this intended? If I pass a bogus object, it will just return 0. Currently, FROZEN_BAD_NAME is never passed to set_frozen_error. |
FROZEN_EXCLUDED is set when frozen modules have no code associated with them, and the _freeze_module tool doesn't seem to be able to produce such output. We could remove it and replace it with an assert, but that does not give us much benefit, so we should probably leave it be and just document it a little bit better. |
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: