Uh oh!
There was an error while loading. Please reload this page.
gh-142029: Raise ModuleNotFoundError instead of crashing on nonexsistent module name given to create_builtin() - #142054
Conversation
dr-carlos
commented
Nov 28, 2025
On further inspection, |
dr-carlos
commented
Dec 1, 2025
No longer relevant for the improved implementation. Thanks to @itamaro. |
dr-carlos
commented
Dec 1, 2025
Tests seem to be failing on Android/iOS because pickled Unfortunately it's not reproducible on my Linux computer (hence the Linux tests passing fine). Not sure if it's trying to compare the new |
dr-carlos
commented
Dec 2, 2025
Sounds good. Would a |
None instead of crashing on nonexsistent module name given to create_builtin()ModuleNotFoundError instead of crashing on nonexsistent module name given to create_builtin()vstinner
commented
Dec 10, 2025
#142033 has been merged instead. |
@vstinner#142033 only fixes one of the two issues included in #142029. The first issue mentioned in that bug report is still unfixed, i.e. the following will crash on >>>import_imp>>>classA: pass
... >>>a=A()
>>>a.name="123">>>_imp.create_builtin(a)But this would raise a |
itamaro
commented
Dec 11, 2025
vstinner
left a comment
There was a problem hiding this comment.
LGTM. But there are now conflicts in Lib/test/test_import/init.py: can you try to solve them? (git merge main)
vstinner
commented
Dec 11, 2025
Oh sorry, I didn't see that the issue had two sub-issues. |
dr-carlos
commented
Dec 11, 2025
Yep, just done so. |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner
commented
Dec 12, 2025
Strange, pickle tests failed on iOS and Android: Example of failure: |
mhsmith
commented
Dec 13, 2025
This error came up in #103247, and I think @freakboy3742 dealt with a more recent instance, but I can't find it now. |
dr-carlos
commented
Dec 13, 2025
Thanks! |
dr-carlos
commented
Dec 14, 2025
Okay, manged to reproduce the error on Linux with |
Uh oh!
There was an error while loading. Please reload this page.
vstinner
commented
Dec 15, 2025
Merged, thanks for the fix. |
bedevere-bot
commented
Dec 15, 2025
|
dr-carlos
commented
Dec 15, 2025
Unfortunately I'm unsure why this buildbot is failing - it's only happening on ARM Raspbian. It's not having issues importing anything (which is what this PR changes). Plus, the failure is only on this one specific test which seems totally unrelated. However, the test only seems to be failing after this commit, and it's happening now on other commits (27a2e49). |
…onexsistent module name given to `create_builtin()` (python#142054) Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner
commented
Dec 16, 2025
The failure seems to be unrelated. |
Py_NewRef(Py_None)was returned in this case; so, theoretically, this should be re-introducing behaviour that was previously broken by that commit.create_builtinwith invalid object #142029