mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
Patch for issue 2848, mostly by Humberto Diogenes, with a couple of
small fixes by Barry. This removes mimetools from the stdlib.
This commit is contained in:
parent
75f25f2c9a
commit
820c120059
23 changed files with 146 additions and 202 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue