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

ensure_dir() should also check for ENOTEMPTY #6426

Closed
BorisZZZ opened this issue Apr 23, 2019 · 4 comments · Fixed by #6427
Closed

ensure_dir() should also check for ENOTEMPTY #6426

BorisZZZ opened this issue Apr 23, 2019 · 4 comments · Fixed by #6427

Comments

@BorisZZZ
Copy link
Contributor

@BorisZZZ BorisZZZ commented Apr 23, 2019

Environment

  • pip version:
    pip 19.0.3

  • Python version:
    python 3.7

  • OS:
    'python:3.7-alpine3.9' docker image (docker-ce 17.9) running on Ubuntu 18.04.2 LTS in WSL (Windows)

Description
pip install pipenv fails with the following error:

Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '/tmp/pip-install-wx86kab7/pipenv/pipenv'

How to Reproduce

  1. Set up environment as described above (alpine3.9, on docker-ce 17.9, running on Ubuntu in WSL). and run the command.

  2. apk --update add --virtual build-dependencies libffi-dev openssl-dev build-base

  3. pip install --upgrade pip

  4. pip install pipenv

Output

Could not install packages due to an EnvironmentError: [Errno 39] Directory not empty: '/tmp/pip-install-wx86kab7/pipenv/pipenv'

Investigation
Compared strace results of a successful run (on a different env) vs the failed run.
On a successful run, the mkdir command is continually executed with /tmp/pip-install-<hash>/pipenv/pipenv as an argument and fails with an EEXIST error. However, on the failed run the same command fails with an ENOTEMPT error. This has to do with the environment itself (maybe docker/windows related), as the same difference is observed when simply performing mkdir from a shell.

@uranusjr

This comment has been minimized.

Copy link
Member

@uranusjr uranusjr commented Apr 24, 2019

Can you provide an example with only mkdir in play instead of pip? I am having trouble believing makedirs could fail with ENOTEMPTY. (And if it does, this seems like a bug in WSL.)

@BorisZZZ

This comment has been minimized.

Copy link
Contributor Author

@BorisZZZ BorisZZZ commented Apr 24, 2019

In an environment such as the one described above (python:3.7-alpine3.9 docker image, docker-ce 17.9, running on Ubuntu 18.04.2 LTS in WSL - see https://medium.com/devopslinks/docker-running-seamlessly-in-windows-subsystem-linux-6ef8412377aa for possible setup), running mkdir on a path that represents a directory that already exists either:

  1. succeeds if the directory is empty, or
  2. fails with ENOTEMPTY error.
@uranusjr

This comment has been minimized.

Copy link
Member

@uranusjr uranusjr commented Apr 24, 2019

So, to summarise, this happens when you install Docker in WSL, and run mkdir in it? It would be more suitable to report this to WSL if that’s the case.

@chrahunt

This comment has been minimized.

Copy link
Member

@chrahunt chrahunt commented Aug 16, 2019

It looks like this change could be related and may help reproducing.

chrahunt added a commit that referenced this issue Nov 28, 2019
@lock lock bot added the S: auto-locked label Dec 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.