Title: cgitb prints html for text when display disabled.
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: aliles, eric.araujo, ncoghlan, python-dev, r.david.murray
Priority: normal Keywords: patch

Created on 2012-08-21 04:36 by aliles, last changed 2012-10-27 21:40 by python-dev.

File name Uploaded Description Edit
p1345523495.diff aliles, 2012-08-21 04:36 Patch for cgitb, uni tests and docs. review
Messages (5)
msg168735 - (view) Author: Aaron Iles (aliles) * Date: 2012-08-21 04:36
If cgitb has been enabled to format as text but suppress the display, the output is formated as html. (Prefixed with <p>)

 >>> gitb.enable(display=0, format='txt')
 >>> raise ValueError('Oops!')
 <p>A problem occurred in a Python script.

The patch changes the prefix used when display is suppressed based on whether output is formatted as html or text. Includes unit tests and documentation updates.
msg169155 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-08-26 02:33
Thanks for the report and patch.  Is this a duplicate of #12890?
msg169157 - (view) Author: Aaron Iles (aliles) * Date: 2012-08-26 04:03
Not an exact duplicate, although I should have seen that issue. Oops.

The 'display' and 'logdir' arguments are independent. Although I do appear to have gone a little overboard and fixed 12890 issue as well. Should I wait for that fix to be merged then reissue the patch?
msg173976 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-10-27 20:27
Issue 12890 fix is now committed.  Perhaps I should have worked with yours instead...but I didn't.  The test solution in that patch, calling python in a separate process, is conceptually simpler but will take more time to run.  I'm on the fence as to which one I prefer, having looked at your patch now...but I'm not sure that your patch cleans up properly, and that fact that that is difficult to figure out argues a bit for the cleaner subprocess solution.  I much prefer tests that run fast, though...
msg173983 - (view) Author: Roundup Robot (python-dev) Date: 2012-10-27 21:40
New changeset 0e4574595674 by R David Murray in branch '3.3':
#12890: skip tests which fail on windows until fixed or rewritten.

New changeset 57a33af85407 by R David Murray in branch 'default':
merge #12890: skip tests which fail on windows until fixed or rewritten.
Date User Action Args
2012-10-27 21:40:09python-devsetnosy: + python-dev
messages: + msg173983
2012-10-27 20:27:56r.david.murraysetversions: + Python 2.7, Python 3.3, Python 3.4
2012-10-27 20:27:37r.david.murraysetnosy: + r.david.murray
messages: + msg173976
2012-08-26 04:03:41alilessetmessages: + msg169157
2012-08-26 02:33:33eric.araujosetnosy: + eric.araujo
messages: + msg169155
2012-08-21 04:36:14alilescreate