Open davisein opened 11 years ago
I suspect this might be fixed on master. Is there any chance you could give it a try, and report whether things work any better? If not, can you post the new traceback? Some things have changed in logcapture.py
.
I just ran into this same issue using version 1.3.1 (and python 3.3).
Traceback (most recent call last):
File "/home/jrs1/lrssystems/workspace/LRSManager/lrsmanager/tests_unit/test_unit_announce.py", line 50, in test_anouncer_announces_and_logs
announcer.announce('testing')
File "/home/jrs1/lrssystems/workspace/LRSManager/lrsmanager/announce.py", line 49, in announce
self.logger.log(announcement, context='announce', tag=key)
File "/home/jrs1/lrssystems/workspace/LRSManager/lrsmanager/logging.py", line 59, in log
pylog.info(message, key)
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 1237, in info
self._log(INFO, msg, args, **kwargs)
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 1372, in _log
self.handle(record)
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 1382, in handle
self.callHandlers(record)
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 1444, in callHandlers
hdlr.handle(record)
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 835, in handle
self.emit(record)
File "/home/jrs1/lrssystems/workspace/env_lrsmanager_py33/lib/python3.3/site-packages/nose/plugins/logcapture.py", line 82, in emit
self.buffer.append(self.format(record))
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 810, in format
return fmt.format(record)
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 548, in format
record.message = record.getMessage()
File "/opt/python3.3/lib/python3.3/logging/__init__.py", line 311, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Do you have a small test case that can reproduce this issue? It's not clear to me what's happening from the traceback, other than something appears to be mis-configured (more args than format fields).
When building the simple test case, I realized that my log string was bad. You called it, more args than format fields. Thanks!
@jsillitoe No problem, glad I could help!
I am executing nosetests and I get the following error:
I have tried with the most recent version with pip and I am getting the same error.
Using unittest on that module successfully runs the test (and fails).
The problem probably lies in that the library that I am testing logs quite extensively and some of the logs might be a problem.
Does anybody has an idea of why it is happening?