Commit 7b741cd5 authored by Emmy Vouriot's avatar Emmy Vouriot Committed by Arnaud Fontaine

fix function names WIP

parent 0a78ef61
...@@ -647,7 +647,7 @@ class ContributionTool(BaseTool): ...@@ -647,7 +647,7 @@ class ContributionTool(BaseTool):
# if a content-disposition header is present, # if a content-disposition header is present,
# try first to read the suggested filename from it. # try first to read the suggested filename from it.
header_info = url_file.info() header_info = url_file.info()
content_disposition = header_info.getheader('content-disposition', '') content_disposition = header_info.get('content-disposition', '')
filename = parse_header(content_disposition)[1].get('filename') filename = parse_header(content_disposition)[1].get('filename')
if not filename: if not filename:
# Now read the filename from url. # Now read the filename from url.
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
# Required modules - some modules are imported later to prevent circular deadlocks # Required modules - some modules are imported later to prevent circular deadlocks
from __future__ import absolute_import from __future__ import absolute_import
from six import int2byte as chr
from six import string_types as basestring from six import string_types as basestring
from six.moves import xrange from six.moves import xrange
import six import six
...@@ -1854,11 +1853,11 @@ def guessEncodingFromText(data, content_type='text/html'): ...@@ -1854,11 +1853,11 @@ def guessEncodingFromText(data, content_type='text/html'):
_reencodeUrlEscapes_map = {chr(x): chr(x) if chr(x) in _reencodeUrlEscapes_map = {chr(x): chr(x) if chr(x) in
# safe # safe
str2bytes("!'()*-." "0123456789" "_~" "!'()*-." "0123456789" "_~"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz"
# reserved (maybe unsafe) # reserved (maybe unsafe)
"#$&+,/:;=?@[]") "#$&+,/:;=?@[]"
else "%%%02X" % x else "%%%02X" % x
for x in xrange(256)} for x in xrange(256)}
......
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