mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-09 00:50:58 +00:00
Python3: fix opening file URLs
urllib.request.urlopen() expects a string or Request object.
This commit is contained in:
parent
eb2e3271a2
commit
4c9ec511b5
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