Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip 9.0 cannot parse UNC paths. #4064

Closed
sgarcialaguna-mms opened this issue Nov 3, 2016 · 10 comments · Fixed by #4071
Closed

pip 9.0 cannot parse UNC paths. #4064

sgarcialaguna-mms opened this issue Nov 3, 2016 · 10 comments · Fixed by #4071
Labels
auto-locked Outdated issues that have been locked by automation
Milestone

Comments

@sgarcialaguna-mms
Copy link

sgarcialaguna-mms commented Nov 3, 2016

  • Pip version: 9.0
  • Python version: 2.7.2
  • Operating System: Windows 10

Description:

I'm trying to install a wheel I've prepared on a UNC share. This works with pip 8.1.2 but not with pip 9.0

What I've run:

With pip 8.1.2:

pip install \\<UNC path>\<package>.whl
[...]
Successfully installed <package>

With pip 9.0:

pip install \\<UNC path>\<package>.whl
Exception:
Traceback (most recent call last):
  File "d:\venv\pip9\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "d:\venv\pip9\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "d:\venv\pip9\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "d:\venv\pip9\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "d:\venv\pip9\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "d:\venv\pip9\lib\site-packages\pip\download.py", line 809, in unpack_url
    unpack_file_url(link, location, download_dir, hashes=hashes)
  File "d:\venv\pip9\lib\site-packages\pip\download.py", line 715, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "d:\venv\pip9\lib\site-packages\pip\utils\__init__.py", line 599, in unpack_file
    flatten=not filename.endswith('.whl')
  File "d:\venv\pip9\lib\site-packages\pip\utils\__init__.py", line 482, in unzip_file
    zipfp = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: 'D:\\<UNC path>\\<package>.whl'
@pfmoore
Copy link
Member

pfmoore commented Nov 3, 2016

The UNC path syntax seems wrong - it should be \\server\share\path\to\file (double backslash at the start). Was that a typo in your report? If not, could you try the correct syntax and confirm if the problem occurs with that?

@sgarcialaguna-mms
Copy link
Author

sgarcialaguna-mms commented Nov 3, 2016

That was just due to missing code tags, thanks for pointing it out.

@dstufft
Copy link
Member

dstufft commented Nov 3, 2016

I don't know anything about UNC on Windows. @pfmoore is this something we should get fixed in a 9.0.1?

@pfmoore
Copy link
Member

pfmoore commented Nov 3, 2016

@dstufft It's a regression from 8.1.2 (just tested it here). I've no immediate feel for how many people this could affect, but I'd be inclined to say it's worth fixing quickly. I'll do some quick checking to see if I can locate the source of the problem, but I don't have a feel yet for how easy a fix will be.

@dstufft dstufft added this to the 9.0.1 milestone Nov 3, 2016
@dstufft
Copy link
Member

dstufft commented Nov 3, 2016

Okay added to 9.0.1 milestone, but I'm probably not personally going to be able to fix it since I don't really know much about UNC on Windows :(

@pfmoore
Copy link
Member

pfmoore commented Nov 3, 2016

OK. Bisect found the issue - introduced by 84c9696 (PR #3724). As a quick resolution, I recommend that we revert that commit. It looks like urllib might be doing funky things with UNC paths, and I don't really have the time to dig into that right now...

@dstufft
Copy link
Member

dstufft commented Nov 3, 2016

Seems like a reasonable idea to me, do you want to do that @pfmoore or want me to?

@pfmoore
Copy link
Member

pfmoore commented Nov 3, 2016

If you have the time, I'd appreciate it. My git skills are limited and I'd rather not risk breaking anything.

@dstufft
Copy link
Member

dstufft commented Nov 3, 2016

Done, I forgot Github has a fancy "revert" button on merged PRs :D

@pfmoore
Copy link
Member

pfmoore commented Nov 3, 2016

Bah. Even I could have managed that! ;-) Thanks.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants