| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
It seems `_ERR_MSG` was silently removed in Python 3.14, leading to an `ImportError` when running the extractor. To fix this, we explicitly set `_ERR_MSG` when the existing import fails (using `_ERR_MSG_PREFIX` which is available in Python 3.14+, along with the bits that make up the difference between this and `_ERR_MSG`).
There was a problem hiding this comment.
This PR fixes a Python 3.14 compatibility issue where the extractor crashes with an ImportError due to the removal of _ERR_MSG from Python's importlib._bootstrap module. The fix implements a fallback mechanism that constructs the error message format when the original import fails.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/extractor/imp.py | Implements try/except fallback to construct _ERR_MSG when not available in Python 3.14+ |
| python/extractor/semmle/util.py | Bumps extractor version from 7.1.4 to 7.1.5 |
| python/ql/lib/change-notes/2025-10-13-fix-importerror-on-python-3.14.md | Documents the Python 3.14 compatibility fix |
Sorry, something went wrong.
There was a problem hiding this comment.
LPTM
Sorry, something went wrong.
Follow-up to github#20630 The fix didn't fully work since when we raise the ImportError in `find_module` we don't pass a named argument into the format string which causes a `KeyError`. We need to use a format string without named arguments, like Python 3.13 and earlier did.
| Back | FazBrowse Home | New Git URL |
It seems _ERR_MSG was silently removed in Python 3.14, leading to an ImportError when running the extractor.
To fix this, we explicitly set _ERR_MSG when the existing import fails (using _ERR_MSG_PREFIX which is available in Python 3.14+, along with the bits that make up the difference between this and _ERR_MSG).