classification
Title: cgitb displays

tags when executed in text mode

Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.3, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, ezio.melotti, mcjeff
Priority: normal Keywords: patch

Created on 2011-09-03 02:22 by mcjeff, last changed 2012-03-13 12:13 by eric.araujo.

Files
File name Uploaded Description Edit
head-cgitb-display.patch mcjeff, 2011-11-21 14:34 review
Messages (10)
msg143449 - (view) Author: Jeff McNeil (mcjeff) Date: 2011-09-03 02:21
If cgitb.enable is ran with a logdir set and a format='text' argument, then a trailing message is printed that includes <p> tags.  This should only happen if the format requested is HTML.

The following tiny script shows the problem:

import cgitb
cgitb.enable(format='text', logdir='/tmp')
1/0

Attaching a small patch which addresses. This is against tip on the default branch.

mcjeff@macbook:~/cpython$ ./python.exe --version
Python 3.3.0a0
msg147956 - (view) Author: Jeff McNeil (mcjeff) Date: 2011-11-19 17:07
Is there anything else needed here?
msg147960 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2011-11-19 17:27
A test?
msg147963 - (view) Author: Jeff McNeil (mcjeff) Date: 2011-11-19 17:57
I didn't add one initially as I was just changing output format and not actual behavior.  I guess I could add something to ensure it doesn't regress? I'll make sure there's coverage to begin with.
msg147965 - (view) Author: Jeff McNeil (mcjeff) Date: 2011-11-19 18:20
Test to ensure html isn't included when the formatting is text.  I don't seem to be able to update the stage.
msg147986 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-20 12:20
Thanks for the updated patch.  I made a review, you should have received an email.  When you make a new patch, it would be most helpful if you could make one patch with code and tests changes, and then we’ll remove the old versions.
msg148005 - (view) Author: Jeff McNeil (mcjeff) Date: 2011-11-20 19:43
Added everything to one file. Updated tests to also include a logdir argument as that is required to trigger the original bug.  Weeded out a spurious write that occurred when format was set to text.
msg148056 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-21 15:24
Latest patch is good to go.
msg155578 - (view) Author: Jeff McNeil (mcjeff) Date: 2012-03-13 08:03
Did this ever get committed? Is there anything left for me to do here?
msg155596 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-03-13 12:13
I’ll apply it shortly.
History
Date User Action Args
2012-03-13 12:13:32eric.araujosetassignee: eric.araujo
messages: + msg155596
2012-03-13 08:03:57mcjeffsetmessages: + msg155578
2011-11-21 15:24:56eric.araujosetmessages: + msg148056
versions: + Python 2.7, Python 3.2
2011-11-21 15:23:50eric.araujosetfiles: - head-cgitb-display.patch
2011-11-21 14:34:24mcjeffsetfiles: + head-cgitb-display.patch
2011-11-21 13:50:17eric.araujosetfiles: - head-cgitb-display-tests.patch
2011-11-21 13:50:14eric.araujosetfiles: - head-cgitb-display.patch
2011-11-20 19:43:43mcjeffsetfiles: + head-cgitb-display.patch

messages: + msg148005
2011-11-20 12:20:32eric.araujosetnosy: + eric.araujo
messages: + msg147986
2011-11-19 18:21:32ezio.melottisetstage: test needed -> patch review
2011-11-19 18:20:41mcjeffsetfiles: + head-cgitb-display-tests.patch

messages: + msg147965
2011-11-19 17:57:08mcjeffsetmessages: + msg147963
2011-11-19 17:27:51ezio.melottisettype: behavior
messages: + msg147960
stage: test needed
2011-11-19 17:07:40mcjeffsetmessages: + msg147956
2011-09-08 10:26:09ezio.melottisetnosy: + ezio.melotti
2011-09-03 02:22:00mcjeffcreate