[ python-Bugs-569316 ] cgi.py broken with xmlrpclib on Python 2
SourceForge.net
noreply at sourceforge.net
Wed Dec 1 03:08:47 CET 2004
Bugs item #569316, was opened at 2002-06-15 05:53
Message generated for change (Comment added) made by facundobatista
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=569316&group_id=5470
Category: Python Library
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Pike (oztourer)
Assigned to: Nobody/Anonymous (nobody)
Summary: cgi.py broken with xmlrpclib on Python 2
Initial Comment:
Given a web application which accepts both normal
HTTP requests and XML-RPC requests, it is
reasonable for that program to assume it can create a
cgi.FieldStorage instance in either case. This works
fine in Python 1.5.2 but causes exceptions in Python
2.x.x when using the created FieldStorage. This is due
to the content-type header generated by xmlrpclib.py
('text/xml') being unrecognised in cgi.py, as a result of
which no FieldStorage.list is created.
One solution is to reinstate some code in cgi.py from
the 1.5.2 release, at the end of method __init__, after
removing the current final two lines:
#else:
# self.read_single()
# SP 2002/6/15: The following code is taken
from the Python 1.5.2 version
# of cgi.py, as incoming xmlrpclib requests
otherwise do not cause 'list'
# to be set up correctly.
elif self.outerboundary:
# we're in an inner part, but the content-type
wasn't something we
# understood. default to read_single()
because the resulting
# FieldStorage won't be a mapping (and
doesn't need to be).
self.read_single()
else:
# we're in an outer part, but the content-type
wasn't something we
# understood. we still want the resulting
FieldStorage to be a
# mapping, so parse it as if it were urlencoded
self.read_urlencoded()
----------------------------------------------------------------------
Comment By: Facundo Batista (facundobatista)
Date: 2004-11-30 23:08
Message:
Logged In: YES
user_id=752496
Please, could you verify if this problem persists in Python 2.3.4
or 2.4?
If yes, in which version? Can you provide a test case?
If the problem is solved, from which version?
Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".
Thank you!
. Facundo
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=569316&group_id=5470
More information about the Python-bugs-list
mailing list