return self.format()
def format(self, indent=' '):
- keys = self.__dict__.keys()
+ keys = list(self.__dict__.keys())
if self.delegate is not None:
keys.remove('delegate')
keys.sort()
if not filename:
# This is better than nothing.
filename = 'index.html'
- if scheme == 'file' and not opts.copy_local:
+ if scheme == b'file' and not opts.copy_local:
# just return the name of the local file - don't make a
# copy currently
- path = url2pathname(path)
+ path = url2pathname(_urlunquote_convert(path))
if host:
- path = os.path.normpath('//' + host + path)
+ path = os.path.normpath('//' + _urlunquote_convert(host) + path)
if not os.path.exists(path):
err = URLGrabError(2,
_('Local file does not exist: %s') % (path, ))
self.curl_obj.setopt(pycurl.SSL_VERIFYPEER, opts.ssl_verify_peer)
if opts.ssl_verify_host: # 1 is meaningless to curl
self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 2)
+ else:
+ self.curl_obj.setopt(pycurl.SSL_VERIFYHOST, 0)
if opts.ssl_key:
self.curl_obj.setopt(pycurl.SSLKEY, opts.ssl_key)
if opts.ssl_key_type:
raise err
# re open it
try:
- self.fo = open(self.filename, 'r')
+ self.fo = open(self.filename, 'rb')
except IOError as e:
err = URLGrabError(16, _('error opening file from %s, IOError: %s')
% (self.url, e))