Commit 2a75dd01 authored by Andreas Jung's avatar Andreas Jung

removed cgi_hotfix since cgi.py is fixed for Python 2.1.3 and latest

Python 2.2.X version
parent 766d3a96
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.84 $'[11:-2] __version__='$Revision: 1.85 $'[11:-2]
import re, sys, os, urllib, time, random, cgi, codecs import re, sys, os, urllib, time, random, cgi, codecs
from types import StringType, UnicodeType from types import StringType, UnicodeType
...@@ -25,10 +25,6 @@ from TaintedString import TaintedString ...@@ -25,10 +25,6 @@ from TaintedString import TaintedString
from maybe_lock import allocate_lock from maybe_lock import allocate_lock
xmlrpc=None # Placeholder for module that we'll import if we have to. xmlrpc=None # Placeholder for module that we'll import if we have to.
#cgi hotfix:
if not hasattr(cgi, 'valid_boundary'):
import cgi_hotfix
isCGI_NAME = { isCGI_NAME = {
'SERVER_SOFTWARE' : 1, 'SERVER_SOFTWARE' : 1,
'SERVER_NAME' : 1, 'SERVER_NAME' : 1,
......
def set_read_multi():
import re
global valid_boundary
valid_boundary = re.compile("^[ -~]{0,200}[!-~]$").match
def read_multi(self, environ, keep_blank_values, strict_parsing):
"""Internal: read a part that is itself multipart."""
ib = self.innerboundary
if not valid_boundary(ib):
raise ValueError, ('Invalid boundary in multipart form: %s'
% `ib`)
self.list = []
klass = self.FieldStorageClass or self.__class__
part = klass(self.fp, {}, ib,
environ, keep_blank_values, strict_parsing)
# Throw first part away
while not part.done:
headers = rfc822.Message(self.fp)
part = klass(self.fp, headers, ib,
environ, keep_blank_values, strict_parsing)
self.list.append(part)
self.skip_lines()
FieldStorage.read_multi = read_multi
import cgi
exec set_read_multi.func_code in cgi.__dict__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment