Imp.get_suffixes has been removed
Removed. The source gives no day. Replacement: importlib.machinery.SOURCE_SUFFIXES, EXTENSION_SUFFIXES and BYTECODE_SUFFIXES. Source: What’s New in Python 3.12.
Check a version:
evergreen check pkg:generic/python
Python 3.12 removed imp.get_suffixes, so using it raises an error.
Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>
| Status | Removed |
| Severity | high |
| Ecosystem | python |
| Component | pkg:generic/python |
| Affected versions | vers:pypi/>=3.12 |
| Date from the source | The source gives no day |
| Replacement | importlib.machinery.SOURCE_SUFFIXES, EXTENSION_SUFFIXES and BYTECODE_SUFFIXES |
| Evidence last seen | 2026-10-21 |
| Reviewed | 2026-10-21 by arminazimi |
| Review due | 2027-10-21 (365 days after the last review) |
| Rule ID | python.symbol.imp.get-suffixes |
Sources
- What’s New in Python 3.12 (accessed 2026-10-21)
Migration
Constraints
- Keep the behavior of the code unchanged; check the replacement’s argument and return-value differences.
Steps
- Replace the usage. Replace each reported use of imp.get_suffixes with importlib.machinery.SOURCE_SUFFIXES, EXTENSION_SUFFIXES and BYTECODE_SUFFIXES.
Verification
python -W error::DeprecationWarning -m pytest: Run the tests with deprecation warnings as errors when pytest is used.
Detected by
The python detector. See Detectors and Compatibility.
Related
Other versions of this product
- ast.Num, Str, Bytes, NameConstant and Ellipsis are deprecated
- asyncio child watcher functions are deprecated
- asyncio.get_event_loop warns when it has to create a loop
- Configparser.SafeConfigParser has been removed
- Ctypes.SetPointerType is deprecated
- datetime.utcfromtimestamp is deprecated
- datetime.utcnow is deprecated
- Glob.glob0 and glob.glob1 are deprecated
- Http.server.CGIHTTPRequestHandler is deprecated
- Imp.cache_from_source has been removed
- Imp.find_module has been removed
- Imp.get_magic has been removed
Same ecosystem
- The aifc module was removed in Python 3.13
- The asynchat module was removed in Python 3.12
- The asyncore module was removed in Python 3.12
- The audioop module was removed in Python 3.13
- The cgi module was removed in Python 3.13
- The cgitb module was removed in Python 3.13
- The chunk module was removed in Python 3.13
- The crypt module was removed in Python 3.13
Data
This page is generated from registry/python.json, rule python.symbol.imp.get-suffixes, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.
Last updated