码迷,mamicode.com
首页 > 其他好文 > 详细

TypeError: not enough arguments for format string

时间:2018-10-12 18:25:58      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:pytho   python3.6   call   erro   back   arguments   typeerror   mes   lin   

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

标签:pytho   python3.6   call   erro   back   arguments   typeerror   mes   lin   

原文地址:https://www.cnblogs.com/hpcm/p/9779931.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!