Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stacked LoggerAdapters cause TypeError when inner adapter has extra=None #138162

Open
Assignees
serhiy-storchaka
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@danoan

Description

@danoan

Bug report

Bug description:

When stacking LoggerAdapter instances in Python's logging module, an exception occurs if the inner adapter is initialized with extra=None. Specifically, the following code:

importlogginglogging.basicConfig(level=logging.DEBUG,format="%(user)s %(message)s")base_logger=logging.getLogger("base")adapter_a=logging.LoggerAdapter(base_logger,extra={"user":"alice"},merge_extra=True)adapter_b=logging.LoggerAdapter(adapter_a)# This raises: TypeError: 'NoneType' object is not a mappingadapter_b.debug("Something")

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp