New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cgitb failures #41022
Comments
cgitb fails when evaluating various reprs/getattrs. The bug 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> |
Logged In: YES Bug fix added |
Logged In: YES The formatting of this patch is wrong. There is a long line |
Confirmed on trunk. |
Anyone interested in running with this as it's still a problem in all versions? |
The output now is c:\Users\Mark\PythonIssues>cgitbbug.py getattr1
3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)]
Traceback (most recent call last):
File "C:\Users\Mark\PythonIssues\cgitbbug.py", line 34, in <module>
d.h('aaa')
File "C:\Users\Mark\PythonIssues\cgitbbug.py", line 23, in _f
raiseError()
File "C:\Users\Mark\PythonIssues\cgitbbug.py", line 3, in raiseError
raise ValueError('original error')
ValueError: original error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mark\PythonIssues\cgitbbug.py", line 36, in <module>
print(cgitb.html(sys.exc_info(),context=3))
File "c:\python34\lib\cgitb.py", line 136, in html
vars = scanvars(reader, frame, locals)
File "c:\python34\lib\cgitb.py", line 88, in scanvars
value = getattr(parent, token, __UNDEF__)
File "C:\Users\Mark\PythonIssues\cgitbbug.py", line 16, in __getattr__
if self._mad=='getattr1': raise ValueError('getattr1 madness')
ValueError: getattr1 madness Thus the madness has been fixed and this can be closed as "out of date". |
I'll repeat the post I made to BreamoreBoy regarding this bug: "re: http://bugs.python.org/issue1047397 this bug is now 10 years old. I'm not sure why it's to be considered I have re-created the original 002 patch with mods for python 3.4.1. It's a bit of a shame that this wasn't fixed 10 years ago. Hopefully any style pedants will find this patch more acceptable. Personally I don't think style errors should prevent a working fix from being adopted. I would have just fixed the fix style and carped afterwards. |
cgi/cgitb are deprecated as per PEP-594, so there won't be further enhancements to them. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: