Fix collections.abc
import error
#2656
Open
+29
β17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of Changes
Description
I was looking into the recent
collections.abc
import error with Python 3.13.1 and wanted to share my findings, regardless of whether this gets merged or not. Hopefully this helps in some way.Did some testing locally with Linux environment and noticed the following:
collections.abc
is not a frozen module and origin is at/usr/lib/python3.12/collections/abc.py
collections.abc
is a frozen moduleNow in the
spec._find_spec
, it is searching in the followingsubmodule_path
-/usr/lib/python3.13/collections
, and giving error when not found. However, we expect it to be unfound as it is a frozen module.There is already existing logic for handling frozen modules in the
ImportlibFinder
class, so perhaps we can utilize that?Closes #XXXX