Merge pull request #291 from cjmayo/python3_33_alt

{python3_33_alt} Python3: fix opening file URLs
This commit is contained in:
anarcat 2019-09-13 10:31:20 -04:00 committed by GitHub
commit aaa8cb675e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,7 @@ Handle local file: links.
import re
import os
import sys
try:
import urlparse
except ImportError:
@ -192,7 +193,10 @@ class FileUrl (urlbase.UrlBase):
if self.is_directory():
self.set_result(_("directory"))
else:
url = fileutil.pathencode(self.url)
if sys.version_info.major < 3:
url = fileutil.pathencode(self.url)
else:
url = self.url
self.url_connection = urlopen(url)
self.check_case_sensitivity()