Skip to content

Use threading.RLock for logging.Handler.lock#16022

Merged
srittau merged 2 commits into
python:mainfrom
pctablet505:fix-handler-lock-rlock
Jul 17, 2026
Merged

Use threading.RLock for logging.Handler.lock#16022
srittau merged 2 commits into
python:mainfrom
pctablet505:fix-handler-lock-rlock

Conversation

@pctablet505

Copy link
Copy Markdown
Contributor

CPython's logging.Handler has stored an RLock (not a plain Lock) in its lock attribute since Python 2.5. threading.RLock is not a subclass of threading.Lock, so the existing stub type was inaccurate.

Fixes #13382

CPython's logging.Handler has used an RLock (not a Lock) since
Python 2.5, and RLock is not a subclass of Lock, so the stub type
was inaccurate.

Fixes python#13382
@github-actions

This comment has been minimized.

@pctablet505
pctablet505 marked this pull request as ready for review July 17, 2026 09:46
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@srittau
srittau merged commit d80e8b7 into python:main Jul 17, 2026
73 checks passed
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.

logging.Handler.lock should actually be threading.RLock

2 participants