Skip to content

Logging Error - TypeError: %d format: a number is required, not NoneType #88

Open
@mar2194

Description

I get this error when using pywebcopy inside of a Docker container:

File "/usr/local/lib/python3.9/logging/__init__.py", line 430, in _format
    return self._fmt % record.__dict__
TypeError: %d format: a number is required, not NoneType"

I tried suppressing logging from this module using:

logging.getLogger("pywebcopy").propagate = False
logging.getLogger("urllib3").propagate = False
logging.getLogger("pywebcopy").setLevel(logging.CRITICAL)
logging.getLogger("urllib3").setLevel(logging.CRITICAL)

But the issue persists. Unfortunately the logging traceback doesn't tell me what line in pywebcopy is causing the problem (this is a general problem with the logging module).
Anyways, it would appear that somewhere in the code there is a debug statement using a variable that doesn't exist:
logging.debug('Some error message %d', non_existent_variable)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions