classification
Title: Minor typo in traceback example
Type: Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: dsm001, georg.brandl, nielsdevos
Priority: normal Keywords: patch

Created on 2009-04-27 13:10 by nielsdevos, last changed 2009-04-27 16:21 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
traceback.example.patch dsm001, 2009-04-27 14:55
Messages (3)
msg86662 - (view) Author: Niels de Vos (nielsdevos) Date: 2009-04-27 13:10
The last example of traceback (found on
<http://docs.python.org/library/traceback.html> release 2.6.2) contains
a typo.

  >>> theError = IndexError('tuple indx out of range')
  >>> traceback.format_exception_only(type(theError), theError)
  ['IndexError: tuple index out of range\n']

IndexError('tuple indx out of range') should be IndexError('tuple index
out of range').
msg86669 - (view) Author: DSM (dsm001) Date: 2009-04-27 14:55
There's more than a typo wrong with the example there-- "import
traceback" doesn't bring format_list into scope, and so it should be
traceback.format_list.

Patch attached which turns the example into something which passes a
doctest.
msg86673 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-04-27 16:21
Fixed in r72007, thanks!
History
Date User Action Args
2009-04-27 16:21:26georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg86673
2009-04-27 14:55:19dsm001setfiles: + traceback.example.patch

nosy: + dsm001
messages: + msg86669

keywords: + patch
2009-04-27 13:10:23nielsdevoscreate