[ python-Bugs-1047397 ] cgitb failures
SourceForge.net
noreply at sourceforge.net
Fri Oct 15 01:33:32 CEST 2004
Bugs item #1047397, was opened at 2004-10-14 22:23
Message generated for change (Comment added) made by rgbecker
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1047397&group_id=5470
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Robin Becker (rgbecker)
Assigned to: Nobody/Anonymous (nobody)
Summary: cgitb failures
Initial Comment:
cgitb fails when evaluating various reprs/getattrs. The bug
demonstrator is cgitbbug.py. Below is the run output
for two bugs. Fixes are possible by putting try: except
around various evaluations. Although the test is
artificial we found these could happen in real code.
This is with 2.4a3 Windows XP
Sample output
C:\Python24>.\python \tmp\cgitbbug.py repr1
2.4a3 (#56, Sep 2 2004, 20:50:21) [MSC v.1310 32 bit
(Intel)]
Traceback (most recent call last):
File "\tmp\cgitbbug.py", line 36, in ?
print cgitb.html(sys.exc_info(),context=3)
File "C:\python24\lib\cgitb.py", line 155, in html
dump.append('%s = %s' % (name,
pydoc.html.repr(value)))
File "C:\python24\lib\pydoc.py", line 352, in repr
return Repr.repr(self, object)
File "C:\python24\lib\repr.py", line 24, in repr
return self.repr1(x, self.maxlevel)
File "C:\python24\lib\pydoc.py", line 359, in repr1
return self.escape(cram(stripid(repr(x)),
self.maxother))
File "\tmp\cgitbbug.py", line 12, in __repr__
if self._mad=='repr1': raise ValueError('repr1
madness')
ValueError: repr1 madness
C:\Python24>.\python \tmp\cgitbbug.py getattr1
2.4a3 (#56, Sep 2 2004, 20:50:21) [MSC v.1310 32 bit
(Intel)]
Traceback (most recent call last):
File "\tmp\cgitbbug.py", line 36, in ?
print cgitb.html(sys.exc_info(),context=3)
File "C:\python24\lib\cgitb.py", line 129, in html
vars = scanvars(reader, frame, locals)
File "C:\python24\lib\cgitb.py", line 83, in scanvars
value = getattr(parent, token, __UNDEF__)
File "\tmp\cgitbbug.py", line 16, in __getattr__
if self._mad=='getattr1': raise
ValueError('getattr1 madness')
ValueError: getattr1 madness
C:\Python24>
----------------------------------------------------------------------
>Comment By: Robin Becker (rgbecker)
Date: 2004-10-14 23:33
Message:
Logged In: YES
user_id=6946
Bug fix added
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1047397&group_id=5470
More information about the Python-bugs-list
mailing list