mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-17 06:20:27 +00:00
Merge pull request #291 from cjmayo/python3_33_alt
{python3_33_alt} Python3: fix opening file URLs
This commit is contained in:
commit
aaa8cb675e
1 changed files with 5 additions and 1 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue