| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
| _datetime.time.max > _datetime.time.min | ||
| _datetime.datetime.max > _datetime.datetime.min | ||
| _datetime.timedelta.max > _datetime.timedelta.min | ||
| isinstance(_datetime.timezone.min, _datetime.tzinfo) |
There was a problem hiding this comment.
Should this have assert?
Sorry, something went wrong.
There was a problem hiding this comment.
assert isinstance(_datetime.timezone.min, _datetime.tzinfo)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
assert not isinstance(_datetime.timezone.min, _datetime.tzinfo)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Both fail, so this checks if it crashes or not. I agree this is not a good example.
Sorry, something went wrong.
There was a problem hiding this comment.
Given that the code looks a bit unusual, it would be worth adding a brief comment explaining that.
(Sorry I didn't notice this during my earlier review. Good catch, @JelleZijlstra.)
Sorry, something went wrong.
There was a problem hiding this comment.
Wouldn't it make sense to have these asserts actually check that the values are of the type they should be? The bug manifested itself as these values appearing to be objects of various random types.
Sorry, something went wrong.
There was a problem hiding this comment.
You could also assert that timezone.__dict__["min"] is timezone.min.
Sorry, something went wrong.
|
Thanks. I'll make a backport PR to 3.13 manually with an assertion to the test case. |
Sorry, something went wrong.
|
GH-120855 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
…H-120829) (#120855) * [3.13] gh-120782: Update internal type cache when reloading datetime When reloading _datetime module, the single-phase version did not invoke the PyInit__datetime function, whereas the current multi-phase version updates the static types through the module init. The outdated static type cache in the interpreter state needs to be invalidated at the end of reloading the multi-phase module.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot iOS ARM64 Simulator 3.13 has failed when building commit 2c3aa52. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/1386/builds/305 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File �[35m"<string>"�[0m, line �[35m12�[0m, in �[35m<module>�[0m
File �[35m"<frozen importlib._bootstrap>"�[0m, line �[35m813�[0m, in �[35mmodule_from_spec�[0m
File �[35m"<frozen importlib._bootstrap_external>"�[0m, line �[35m1316�[0m, in �[35mcreate_module�[0m
File �[35m"<frozen importlib._bootstrap>"�[0m, line �[35m488�[0m, in �[35m_call_with_frames_removed�[0m
�[1;35mImportError�[0m: �[35mdlopen(/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/lib-dynload/_testcapi.cpython-313d-iphonesimulator.fwork, 0x0002): tried: '/Users/buildbot/buildarea/3.13.rkm-arm64-ios-simulator.iOS-simulator.arm64/build/build_oot/host/iOSTestbed.arm64-iphonesimulator.1719996652/DerivedData/Build/Products/Debug-iphonesimulator/_testcapi.cpython-313d-iphonesimulator.fwork' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib/_testcapi.cpython-313d-iphonesimulator.fwork' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/lib-dynload/_testcapi.cpython-313d-iphonesimulator.fwork' (no such file), '/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/lib-dynload/_testcapi.cpython-313d-iphonesimulator.fwork' (not a mach-o file)�[0m
Traceback (most recent call last):
File �[35m"<string>"�[0m, line �[35m12�[0m, in �[35m<module>�[0m
File �[35m"<frozen importlib._bootstrap>"�[0m, line �[35m813�[0m, in �[35mmodule_from_spec�[0m
File �[35m"<frozen importlib._bootstrap_external>"�[0m, line �[35m1316�[0m, in �[35mcreate_module�[0m
File �[35m"<frozen importlib._bootstrap>"�[0m, line �[35m488�[0m, in �[35m_call_with_frames_removed�[0m
�[1;35mImportError�[0m: �[35mdlopen(/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/lib-dynload/_testcapi.cpython-313d-iphonesimulator.fwork, 0x0002): tried: '/Users/buildbot/buildarea/3.13.rkm-arm64-ios-simulator.iOS-simulator.arm64/build/build_oot/host/iOSTestbed.arm64-iphonesimulator.1719996652/DerivedData/Build/Products/Debug-iphonesimulator/_testcapi.cpython-313d-iphonesimulator.fwork' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib/_testcapi.cpython-313d-iphonesimulator.fwork' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/lib-dynload/_testcapi.cpython-313d-iphonesimulator.fwork' (no such file), '/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/lib-dynload/_testcapi.cpython-313d-iphonesimulator.fwork' (not a mach-o file)�[0m
Traceback (most recent call last):
File "/Users/buildbot/Library/Developer/XCTestDevices/22CEEEC0-69AF-41A1-B570-E2195120FCE2/data/Containers/Bundle/Application/781AEFA7-0473-4CB0-82EE-01996600BD3C/iOSTestbed.app/python/lib/python3.13/test/datetimetester.py", line 6828, in test_type_check_in_subinterp
self.assertEqual(ret, 0)
~~~~~~~~~~~~~~~~^^^^^^^^
AssertionError: -1 != 0
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
When reloading _datetime module, the single-phase version did not invoke the PyInit__datetime function, whereas the current multi-phase version updates the static types through the module init. The outdated static type cache in the interpreter state needs to be invalidated at the end of reloading the multi-phase module.