close
Skip to content

ensure_dir() should also check for ENOTEMPTY #6426

@BorisZZZ

Description

@BorisZZZ

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS: windowsWindows specificauto-lockedOutdated issues that have been locked by automation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions