This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amezhenin
Recipients amezhenin
Date 2013-07-09.12:42:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1373373765.43.0.0479978783535.issue18413@psf.upfronthosting.co.za>
In-reply-to
Content
Hello.
I noticed strange behavior of logging module, when debugging my code:

$ python
Python 2.7.3 (default, Aug  1 2012, 05:14:39) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.error('asdf')
ERROR:root:asdf
>>> logging.error('asdf', extra={'msg':123})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/logging/__init__.py", line 1575, in error
    root.error(msg, *args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1166, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib/python2.7/logging/__init__.py", line 1257, in _log
    record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
  File "/usr/lib/python2.7/logging/__init__.py", line 1235, in makeRecord
    raise KeyError("Attempt to overwrite %r in LogRecord" % key)
KeyError: "Attempt to overwrite 'msg' in LogRecord"


Originally code was extra=locals() and 'msg' was local variable, but it doesn't matter.
History
Date User Action Args
2013-07-09 12:42:45amezheninsetrecipients: + amezhenin
2013-07-09 12:42:45amezheninsetmessageid: <1373373765.43.0.0479978783535.issue18413@psf.upfronthosting.co.za>
2013-07-09 12:42:45amezheninlinkissue18413 messages
2013-07-09 12:42:45amezhenincreate