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

Wheel command does not work if the directory contains a socket #2974

Closed
hackaugusto opened this issue Jul 13, 2015 · 2 comments
Closed

Wheel command does not work if the directory contains a socket #2974

hackaugusto opened this issue Jul 13, 2015 · 2 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@hackaugusto
Copy link

I'm using blackbox to manage my secrets, it changes the gpg homedir to $GIT_REPO/keyrings/live forcing the gpg-agent to create a socket named $GIT_REPO/keyrings/live/S.gpg-agent, since my setup.py is side-by-side with the keyrings pip wheel . fails:

Exception:
Traceback (most recent call last):
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/commands/wheel.py", line 194, in run
    if not wb.build():
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/wheel.py", line 706, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 334, in prepare_files
    functools.partial(self._prepare_file, finder))
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
    more_reqs = handler(req_to_install)
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/req/req_set.py", line 491, in _prepare_file
    session=self.session)
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/download.py", line 814, in unpack_url
    unpack_file_url(link, location, download_dir)
  File "/home/hack/work/envs/oca-2.7/lib/python2.7/site-packages/pip/download.py", line 699, in unpack_file_url
    shutil.copytree(link_path, location, symlinks=True)
  File "/usr/lib64/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
Error: [('/home/hack/work/projects/oca/keyrings/live/S.gpg-agent', '/tmp/pip-UfkYbS-build/keyrings/live/S.gpg-agent', "[Errno 6] No such device or address: '/home/hack/work/projects/oca/keyrings/live/S.gpg-agent'")]

As a work around I'm doing a first copy myself and removing the keyrings directory.

Note: $GIT_REPO is not the .git but the folder that cotains it.

@oz123
Copy link
Contributor

oz123 commented Mar 31, 2016

I can confirm this bug. Here is my setup:

I am trying to install my package from a directory where there is a subdirectory conf containing the uwsgi socket.

$ ls
MANIFEST.in  Makefile  build  conf  dist  docs  fabfile.py  fixtures  manage.py  requirements.txt   setup.py  share_analytics.egg-info  sharescreening  static  test_requirements.txt

These works fine:

python setup.py install
pip install -e .

Issuing pip install . first tries to copy the current directory before reading setup.py and checking for setup(packages=...).
When it does this it calls shutil.copytree which can't handle sockets.

$ python
Python 2.7.9 (default, Mar  1 2015, 12:57:24) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.copytree('conf', 'bla')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/shutil.py", line 208, in copytree
    raise Error, errors
shutil.Error: [('conf/sharescreening.sock', 'bla/sharescreening.sock', "[Errno 6] No such device or address: 'conf/sharescreening.sock'")]
>>> 

That is obvious that sockets can't be copied, so maybe pip should know about this? Ofcourse there is a work around here. But I think the issue here is that pip is bluntly using shutil.copytree.

@pradyunsg
Copy link
Member

Closing as a duplicate of #2195. I'm not 100% sure here but reopening is a cheap operation. :)

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 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

No branches or pull requests

3 participants