From 820c1200597606f95bb996586be88a3283c6448c Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 12 Jun 2008 04:06:45 +0000 Subject: Patch for issue 2848, mostly by Humberto Diogenes, with a couple of small fixes by Barry. This removes mimetools from the stdlib. --- Lib/cgi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Lib/cgi.py') diff --git a/Lib/cgi.py b/Lib/cgi.py index caf54bdd9f..c7171ca69d 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -249,6 +249,8 @@ def parse_multipart(fp, pdict): since it can call parse_multipart(). """ + import http.client + boundary = "" if 'boundary' in pdict: boundary = pdict['boundary'] @@ -266,8 +268,8 @@ def parse_multipart(fp, pdict): data = None if terminator: # At start of next part. Read headers first. - headers = mimetools.Message(fp) - clength = headers.getheader('content-length') + headers = http.client.parse_headers(fp) + clength = headers.get('content-length') if clength: try: bytes = int(clength) -- cgit v1.2.1