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 vinay.sajip
Recipients mdt, vinay.sajip
Date 2013-08-06.21:09:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375823391.98.0.540489527162.issue18671@psf.upfronthosting.co.za>
In-reply-to
Content
In recent versions of Python, information *is* printed which allows pinpointing the source of the formatting error. Consider the following script, logex.py:

import logging

logger = logging.getLogger(__name__)

def test():
    logger.debug('The result is ', 'abc')

def main():
    test()

if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)
    main()

When this is run with Python 2.7:

$ python logex.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 842, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 719, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file logex.py, line 6

With Python 3.2:

$ python3.2 logex.py
Traceback (most recent call last):
  File "/usr/lib/python3.2/logging/__init__.py", line 937, in emit
    msg = self.format(record)
  File "/usr/lib/python3.2/logging/__init__.py", line 812, in format
    return fmt.format(record)
  File "/usr/lib/python3.2/logging/__init__.py", line 551, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.2/logging/__init__.py", line 319, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file logex.py, line 6

As you can see, the filename and line number are identified, so you can see precisely where the formatting error is.
History
Date User Action Args
2013-08-06 21:09:52vinay.sajipsetrecipients: + vinay.sajip, mdt
2013-08-06 21:09:51vinay.sajipsetmessageid: <1375823391.98.0.540489527162.issue18671@psf.upfronthosting.co.za>
2013-08-06 21:09:51vinay.sajiplinkissue18671 messages
2013-08-06 21:09:51vinay.sajipcreate