You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
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
assignee=Noneclosed_at=Nonecreated_at=<Date2021-10-05.15:52:00.008>labels= ['interpreter-core', 'type-bug', '3.11']
title='Improve errors related to frozen modules.'updated_at=<Date2021-10-29.20:55:22.610>user='https://github.com/ericsnowcurrently'
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:
the conditions for the statuses are unclear 
the error messages could be more helpful 
maybe use a different error message for FROZEN_BAD_NAME (and perhaps FROZEN_DISABLED), rather than combining with FROZEN_NOT_FOUND
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.
This does not seem right.
Currently, FROZEN_BAD_NAME is never passed to set_frozen_error.