1. 程式人生 > >TypeError: not enough arguments for format string

TypeError: not enough arguments for format string

error: string pytho span mod logger error ESS ini

Error msg:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/__init__.py", line 993, in emit
    msg = self.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 839, in format
    return fmt.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 579, in
format s = self.formatMessage(record) File "/usr/lib/python3.6/logging/__init__.py", line 548, in formatMessage return self._style.format(record) File "/usr/lib/python3.6/logging/__init__.py", line 391, in format return self._fmt % record.__dict__ TypeError: not enough arguments for format string Call stack: File
"start.py", line 7, in <module> Engine().start() File "/home/hpcm/Desktop/spider/13-frame_spider/myscrapy/core/engine.py", line 45, in start logger.info("End time is [ {} ]".format(end)) Message: End time is [ 2018-09-27 17:55:54.795786 ] Arguments: ()

問題:

  setting中的log使用的DEFAULT_LOG_FMT參數出錯

解決:

  檢查參數是否寫錯, 或者多項少項

TypeError: not enough arguments for format string