Repository navigation
Fix Python 3.11+ crash in EquinixMetal list_resources_async - #2218
Open
Hisernberg wants to merge 2 commits into
Open
Hisernberg wants to merge 2 commits into
Hisernberg wants to merge 2 commits into
Conversation
Python 3.12 deprecates datetime.utcnow(). All 9 call sites now use datetime.now(timezone.utc).replace(tzinfo=None): - identical naive-UTC values for every consumer (SigV4/SAS signing, X-*-Date headers, token-expiry arithmetic) - GoogleBaseConnection._utcnow() stays naive so the existing GoogleTestCase mock and the token-expiry comparisons keep working - utctimetuple() rendering in openstack_identity unchanged
The exec() crutch used @asyncio.coroutine and 'yield from', both removed in Python 3.11, so every call raised AttributeError: module 'asyncio' has no attribute 'coroutine' (verified). The comment itself says the exec existed only for Python 2 SyntaxError avoidance; replaced with a plain async method. Semantics preserved: executor threads per project, results concatenated in project order.
Contributor
|
It looks like the first commit (262f80d) contains unrelated changes that have already been merged into trunk. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
list_resources_asyncbuilt_list_asyncviaexec()using@asyncio.coroutineandyield from— both removed in Python 3.11 — so any call raises:(verified by running the same exec snippet on 3.12). The code comment already says the exec existed only to avoid a Python 2
SyntaxErrorfromyield from, and Python 2 support is long gone.Replaced with a plain
async def _list_async()+await. Semantics preserved: one executor job per project, results concatenated in project order (same as before).