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

Created on 2012-08-21 04:36 by aliles, last changed 2019-03-14 13:17 by cheryl.sabella.

File name Uploaded Description Edit
p1345523495.diff aliles, 2012-08-21 04:36 Patch for cgitb, uni tests and docs. review
Pull Requests
URL Status Linked Edit
PR 12316 open remi.lapeyre, 2019-03-14 00:06
Messages (8)
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) (Python triager) 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.
msg337742 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-03-12 14:23
I can still recreate this issue under 3.8.  Should this patch be converted to a GitHub pull request?
msg337890 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-03-14 00:07
Hi Cheryl, I updated and converted the path. Could you please review the PR?
msg337913 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2019-03-14 13:17
Hi Rémi, 

I think @r.david.murray would need to review the PR, based on his last comment.  That's why I was asking whether the patch should be converted to a PR.  There seemed to be a conflict between this and issue 12890 and I wasn't certain which parts of this one were still useful.

However, having the PR may make it easier to review, so thank you for opening it.
Date User Action Args
2019-03-14 13:17:06cheryl.sabellasetmessages: + msg337913
2019-03-14 00:07:31remi.lapeyresetnosy: + remi.lapeyre
messages: + msg337890
2019-03-14 00:06:47remi.lapeyresetstage: patch review
pull_requests: + pull_request12290
2019-03-12 14:23:28cheryl.sabellasetnosy: + cheryl.sabella

messages: + msg337742
versions: + Python 3.7, Python 3.8, - Python 2.7, Python 3.2, Python 3.3, Python 3.4
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