fix: restore logging lock compatibility for py3.13#1073
fix: restore logging lock compatibility for py3.13#1073BobTheBuidler merged 7 commits intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8df4ea98d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dank_mids/logging.py
Outdated
| _nameToLevel: Final = logging._nameToLevel | ||
| _acquireLock: Final = logging._acquireLock # type: ignore [attr-defined] | ||
| _releaseLock: Final = logging._releaseLock # type: ignore [attr-defined] | ||
| _acquireLock = getattr(logging, "_acquireLock", None) |
There was a problem hiding this comment.
Rebuild shipped 3.13 logging extension with this fix
This change updates only dank_mids/logging.py, but in the checked repository CPython 3.13 imports dank_mids.logging from the prebuilt dank_mids/logging.cpython-313-*.so extension first, so these new fallback assignments never execute and the import-time logging._acquireLock failure remains for compiled builds. To actually deliver the compatibility fix in the environments that consume the bundled extensions, the 3.13 binary artifact needs to be regenerated and committed with the source patch.
Useful? React with 👍 / 👎.
Summary
from __future__ import annotationsto defer logging type annotation evaluationlogging._lock.acquire/releasewhen_acquireLock/_releaseLockare missingRationale
logging._acquireLock/_releaseLock, causing import-time crashes indank_mids.loggingduring unit test collectionDetails
getattrto detect missing private APIs and bind to the internal lock directly