TypeError:在字符串格式化期间(运行单元测试时)未转换所有参数

2024-04-25 21:29:55 发布

您现在位置:Python中文网/ 问答频道 /正文

在重新启动计算机后,我在Linux环境中的eclipse luna上的PyDev中开始出现以下错误:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 846, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file post_worker.py, line 105
Traceback (most recent call last):
  File "/usr/lib64/python2.7/logging/__init__.py", line 846, in emit
    msg = self.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 723, in format
    return fmt.format(record)
  File "/usr/lib64/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib64/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file post_worker.py, line 105

当我尝试运行单元测试时,任何一个都会发生这种情况。而且,只有在IDE中运行命令时才会发生问题。你知道吗


Tags: inpyselfformatmostinitusrlogging