Skip to content

Should logging.Handler.lock allow None? #13381

Open
@gsnedders

Description

Since python/cpython@74723e1 (in CPython 3.13 and later), a variety of calls of Handler.acquire() and Handler.release() got converted into with Handler.lock.

As a result, unless you're overriding Handler.handle, Handler.lock cannot be None, which it could be previously.

Note that logging.NullHandler does actually set lock to None in the stdlib, but it does override Handler.handle.

I’m unsure about the policy for typeshed is about instance variables whose valid values depend on whether a particular method is overridden.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions