[ python-Bugs-1515163 ] traceback now masks some string exceptions

SourceForge.net noreply at sourceforge.net
Fri Jun 30 16:34:27 CEST 2006


Bugs item #1515163, was opened at 2006-06-30 10:34
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1515163&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Jim Jewett (jimjjewett)
Assigned to: Nobody/Anonymous (nobody)
Summary: traceback now masks some string exceptions

Initial Comment:
With 2.5, exceptions became new-style.  Unfortunately, 
the traceback module wasn't fully updated to still 
properly handle all (admittedly deprecated) string 
exceptions.  I noticed this because of its affect on 
unittest, where the original exception was masked.

Under 2.4.3:

>>> import traceback
>>> traceback.format_exception_only("strtype", 
"strvalue")
['strtype: strvalue\n']

Under 2.5b1:
>>> import traceback
>>> traceback.format_exception_only("strtype", 
"strvalue")

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    traceback.format_exception_only("strtype", 
"strvalue")
  File "C:\Python25\lib\traceback.py", line 168, in 
format_exception_only
    if issubclass(etype, SyntaxError):
TypeError: issubclass() arg 1 must be a class

I will also be entering a patch, but know that we need 
a bug number at this stage.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1515163&group_id=5470


More information about the Python-bugs-list mailing list