web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
4.79k stars 2.99k forks source link

serve: Fix exception in logger usage #46897

Closed TingPing closed 4 days ago

TingPing commented 1 week ago

The Logger.critical method doesn't take a file argument, at least in Python 3.12:

>>> import logging
>>> logging.getLogger().critical('test', file=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.12/logging/__init__.py", line 1586, in critical
    self._log(CRITICAL, msg, args, **kwargs)
TypeError: Logger._log() got an unexpected keyword argument 'file'