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

--cache-dir does not support relative paths to non-existent directory #7541

Closed
sbidoul opened this issue Jan 2, 2020 · 0 comments · Fixed by #7542
Closed

--cache-dir does not support relative paths to non-existent directory #7541

sbidoul opened this issue Jan 2, 2020 · 0 comments · Fixed by #7542

Comments

@sbidoul
Copy link
Member

@sbidoul sbidoul commented Jan 2, 2020

Environment

  • pip version: 19.3, master
  • Python version: N/A
  • OS: N/A

Description

When running pip install --cache-dir=cache one expects pip to use $PWD/cache as cache directory. It works when the directory exists but not when it does not exist yet.

With pip 19.3, we get a warning about the cache directory not being writable, but the cache directory is created anyway.

With pip master, we get the warning and the cache is not created (following the fix for #7488). Providing an absolute directory for --cache-dir works correctly.

Expected behavior

When the cache directory does not exist, it should be created without warning.

How to Reproduce

pip install --cache-dir=cache flit.

With pip master, notice the cache directory is not created.

pip install --cache-dir=$PWD/cache flit.

With pip master, notice the cache directory is created correctly.

@triage-new-issues triage-new-issues bot added the triage label Jan 2, 2020
@sbidoul sbidoul added the type: bug label Jan 2, 2020
@triage-new-issues triage-new-issues bot removed the triage label Jan 2, 2020
@sbidoul sbidoul added this to the 20.0 milestone Jan 2, 2020
sbidoul added a commit to sbidoul/pip that referenced this issue Jan 2, 2020
Fixes pypa#7541
sbidoul added a commit to sbidoul/pip that referenced this issue Jan 2, 2020
Fixes pypa#7541
@sbidoul sbidoul added the C: cache label Jan 2, 2020
sbidoul added a commit to sbidoul/pip that referenced this issue Jan 8, 2020
Fixes pypa#7541
deepak1725 added a commit to deepak1725/pip that referenced this issue Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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