◐ Shell
reader mode source ↗
Skip to content

gh-120782: Update internal type cache when reloading datetime#120829

Merged
kumaraditya303 merged 3 commits into
python:mainfrom
neonene:reload
Jun 21, 2024
Merged

gh-120782: Update internal type cache when reloading datetime#120829
kumaraditya303 merged 3 commits into
python:mainfrom
neonene:reload

Conversation

@neonene

@neonene neonene commented Jun 21, 2024

Copy link
Copy Markdown
Contributor

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.

@neonene

neonene commented Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

LGTM

@Eclips4 Eclips4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hide comment

Thanks!

@kumaraditya303 kumaraditya303 merged commit a81d434 into python:main Jun 21, 2024
@neonene

neonene commented Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

Thanks. I'll make a backport PR to 3.13 manually with an assertion to the test case.

@bedevere-app

bedevere-app Bot commented Jun 21, 2024

Copy link
Copy Markdown

GH-120855 is a backport of this pull request to the 3.13 branch.

@neonene neonene deleted the reload branch June 21, 2024 20:13
kumaraditya303 pushed a commit that referenced this pull request Jul 3, 2024
…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.
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot iOS ARM64 Simulator 3.13 has failed when building commit 2c3aa52.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1386/builds/305) and take a look at the build logs.
  4. Check if the failure is related to this commit (2c3aa52) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1386/builds/305

Failed tests:

  • test_datetime

Failed subtests:

  • test_type_check_in_subinterp - test.datetimetester.CapiTest_Fast.test_type_check_in_subinterp

Summary of the results of the build (if available):

==

Click to see traceback logs
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 �[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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants