rajatomar788 / pywebcopy

Locally saves webpages to your hard disk with images, css, js & links as is.
https://rajatomar788.github.io/pywebcopy/
Other
520 stars 105 forks source link

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

Open mar2194 opened 2 years ago

mar2194 commented 2 years ago

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)

rajatomar788 commented 2 years ago

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"

This seems to be occurring in the logging library itself, I think it is a particular usecase problem.