Skip to content

[logging-unsupported-format] false negative if no logging args are supplied #10752

@stanislavlevin

Description

@stanislavlevin

Bug description

According to https://docs.python.org/3/library/logging.html#logging.Logger.debug

No % formatting operation is performed on msg when no args are supplied.

The following code is valid:

# pylint: disable=missing-module-docstring,
import logging

logging.error("%test")

Command used

python3 -m pylint --enable E1200 test.py

Pylint output

************* Module test
test.py:4:0: E1200: Unsupported logging format character 't' (0x74) at index 1 (logging-unsupported-format)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

Expected behavior

No error reported.

Pylint version

pylint 4.0.3
astroid 4.0.2
Python 3.13.9 (main, Nov  9 2025, 20:22:19) [GCC 14.3.1 20251017 (ALT Sisyphus 14.3.1-alt2)]

OS / Environment

ALTLinux Sisyphus

Metadata

Metadata

Assignees

No one assigned

    Labels

    False Positive 🦟A message is emitted but nothing is wrong with the codeGood first issueFriendly and approachable by new contributorsNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions