| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
On further inspection, is_core_module() is only defined under an #ifndef NDEBUG statement (since it was only used in assert() calls), so it's not valid to use in non-debug builds. Would it be acceptable to move this out of the #if? |
Sorry, something went wrong.
No longer relevant for the improved implementation. Thanks to @itamaro. |
Sorry, something went wrong.
|
Tests seem to be failing on Android/iOS because pickled __loader__ is not builtins.__loader__. This is probably because __loader__.create_module calls _imp.create_builtin(), which was modified in this PR. 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 __loader__ with the old __loader__ from a previous Python version? |
Sorry, something went wrong.
Sounds good. Would a ModuleNotFoundError be most appropriate here? |
Sorry, something went wrong.
|
@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 main: >>> import _imp
>>> class A: pass
...
>>> a = A()
>>> a.name = "123"
>>> _imp.create_builtin(a)But this would raise a ModuleNotFoundError were this PR merged. |
Sorry, something went wrong.
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)
Sorry, something went wrong.
|
Oh sorry, I didn't see that the issue had two sub-issues. |
Sorry, something went wrong.
Yep, just done so. |
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
|
Strange, pickle tests failed on iOS and Android: 2 re-run tests:
test_pickle test_pickletools
Example of failure: ERROR: test_builtin_types (test.test_pickletools.OptimizedPickleTests.test_builtin_types)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/data/user/0/org.python.testbed/files/python/lib/python3.15/test/pickletester.py", line 3217, in test_builtin_types
s = self.dumps(t, proto)
File "/data/user/0/org.python.testbed/files/python/lib/python3.15/test/test_pickletools.py", line 16, in dumps
return pickletools.optimize(pickle.dumps(arg, proto, **kwargs))
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
_pickle.PicklingError: Can't pickle <class 'importlib._bootstrap.BuiltinImporter'>: it's not the same object as importlib._bootstrap.BuiltinImporter
|
Sorry, something went wrong.
|
This error came up in #103247, and I think @freakboy3742 dealt with a more recent instance, but I can't find it now. |
Sorry, something went wrong.
Thanks! |
Sorry, something went wrong.
|
Okay, manged to reproduce the error on Linux with ./python -m test test_import test_importlib test_pickletools. Turns out that you can uncache the builtins module, but then other tests in importlib break. I couldn't find a proper fix, so for now, I've re-added the test with sys, leaving the builtins one out. |
Sorry, something went wrong.
|
Merged, thanks for the fix. |
Sorry, something went wrong.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot ARM Raspbian 3.x (tier-3) has failed when building commit cd2ca74. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/424/builds/12349 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_annotationlib.py", line 160, in test_nonexistent_attribute
self.assertEqual(epsilon_anno, support.EqualToForwardRef("some | {obj, module}", owner=f))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: ForwardRef('some | {module, obj}', owner=[79 chars]3f0>) != EqualToForwardRef('some | {obj, module}',[86 chars]3f0>)
Traceback (most recent call last):
File "/var/lib/buildbot/workers/3.x.gps-raspbian.nondebug/build/Lib/test/test_annotationlib.py", line 160, in test_nonexistent_attribute
self.assertEqual(epsilon_anno, support.EqualToForwardRef("some | {obj, module}", owner=f))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: ForwardRef('some | {module, obj}', owner=[79 chars]760>) != EqualToForwardRef('some | {obj, module}',[86 chars]760>)
|
Sorry, something went wrong.
|
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). |
Sorry, something went wrong.
…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>
The failure seems to be unrelated. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.