mirror of https://github.com/pypa/pip
better directory-ness checking for file: scheme index URLs
This commit is contained in:
parent
5618ec1634
commit
1734bf0d6c
|
@ -386,8 +386,8 @@ class HTMLPage(object):
|
|||
logger.debug('Getting page %s' % url)
|
||||
|
||||
# Tack index.html onto file:// URLs that point to directories
|
||||
# normcase helpfully translates path separators for us on Windows
|
||||
if url.startswith('file://') and os.path.isdir(os.path.normcase(url[7:])):
|
||||
(scheme, netloc, path, params, query, fragment) = urlparse.urlparse(url)
|
||||
if scheme == 'file' and os.path.isdir(urllib.url2pathname(path)):
|
||||
url = urllib.basejoin(url, 'index.html')
|
||||
|
||||
resp = urlopen(url)
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
This directory has the odd space in its name in order to test urlquoting and
|
||||
dequoting of file:// scheme index URLs.
|
|
@ -1,7 +1,9 @@
|
|||
import urllib2
|
||||
|
||||
from test_pip import here, reset_env, run_pip, pyversion
|
||||
from path import Path
|
||||
|
||||
index_url = 'file://' + str(Path(here).abspath/'index').replace('\\', '/')
|
||||
index_url = 'file://' + urllib2.quote(str(Path(here).abspath/'in dex').replace('\\', '/'))
|
||||
|
||||
def test_install():
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue