IVLE does not serve output from cgitb
Bug #979598 reported by
Marco Lui
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
IVLE |
Invalid
|
Medium
|
Unassigned |
Bug Description
Steps to reproduce
Attempt to serve the following:
import cgitb; cgitb.enable(
Expected outcome:
output of cgitb served as text/html
Actual outcome:
warning about invalid CGI header, followed by
/usr/lib/
value = pydoc.html.
<!--: spam
Content-Type: text/html
To post a comment you must log in.
Interesting. I guess the cgitb module is trying to generate output that is both valid as CGI and HTML. Unfortunately I don't believe that "<!--" is a valid field name for a HTTP header, hence why IVLE rejects it (http:// www.w3. org/Protocols/ rfc2616/ rfc2616- sec4.html# sec4.2 states "field-name" must be a valid token and http:// www.w3. org/Protocols/ rfc2616/ rfc2616- sec2.html# sec2.2 explicitly disallows the separator "<" from being a valid token). This is probably an upstream Python bug.
Despite this, not working with Python's built-in cgitb module is a pretty poor experience.
The second warning is due to cgitb module needing to be updated in the Python standard library. Looks like it's fixed in newer versions of Python, but in the meantime you can silence it using the warning module (http:// docs.python. org/library/ warnings. html).