This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: cgi.py broken with xmlrpclib on Python 2
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, oztourer
Priority: normal Keywords:

Created on 2002-06-15 08:53 by oztourer, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cgi.py oztourer, 2002-06-15 08:53 Modified to handle incoming XML-RPC requests
Messages (3)
msg11210 - (view) Author: Steve Pike (oztourer) Date: 2002-06-15 08:53
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()
msg11211 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2004-12-01 02:08
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
msg11212 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-03-22 22:09
Logged In: YES 
user_id=752496

Deprecated. Reopen only if still happens in 2.3 or newer. 

.    Facundo
History
Date User Action Args
2022-04-10 16:05:25adminsetgithub: 36752
2002-06-15 08:53:45oztourercreate