Skip to content

Fix user directory expansion when HOME=/ #3136

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

Merged
merged 3 commits into from
Sep 29, 2015

Conversation

rouge8
Copy link
Contributor

@rouge8 rouge8 commented Sep 24, 2015

On versions of CPython affected by http://bugs.python.org/issue14768 (Python 2.6, some versions of Python 2.7 and 3.3), os.path.expanduser('~/path') returns //path rather than /path when HOME=/. This affects pip when os.path.expanduser('~/.cache/pip') is expanded to /\\\\.cache/pip. Although HOME=/ is probably uncommon on most Linux systems, it is extremely common in Docker images.

Fixes #2996.

@rouge8 rouge8 force-pushed the fix-py26-home-slash branch from 904daae to c3fdbae Compare September 29, 2015 18:40
@rouge8
Copy link
Contributor Author

rouge8 commented Sep 29, 2015

I rebased off the latest develop and it looks like the tests are passing now.

@xavfernandez
Copy link
Member

I think it would make more sense to provide a fixed version of os.path.expanduser in pip/compat/__init__.py: this would provide it to the whole pip codebase.

@rouge8
Copy link
Contributor Author

rouge8 commented Sep 29, 2015

@xavfernandez done and updated the rest of the codebase to use it.

@xavfernandez
Copy link
Member

Great ! Could you also add a changelog to CHANGES.txt ?

@rouge8 rouge8 force-pushed the fix-py26-home-slash branch from 7b17622 to 2adf569 Compare September 29, 2015 19:53
@rouge8
Copy link
Contributor Author

rouge8 commented Sep 29, 2015

Done!

Andy Freeland added 3 commits September 29, 2015 16:01
On versions of CPython affected by <http://bugs.python.org/issue14768>
(Python 2.6, some versions of Python 2.7 and 3.3),
`os.path.expanduser('~/path')` returns `//path` rather than `/path` when
`HOME=/`. This affects pip when `os.path.expanduser('~/.cache/pip')` is
expanded to `/\\\\.cache/pip`. Although `HOME=/` is probably uncommon on
most Linux systems, it is extremely common in Docker images.

Fixes pypa#2996.
@rouge8 rouge8 force-pushed the fix-py26-home-slash branch from 2adf569 to 73a439e Compare September 29, 2015 20:01
xavfernandez added a commit that referenced this pull request Sep 29, 2015
Fix user directory expansion when HOME=/
@xavfernandez xavfernandez merged commit fe28652 into pypa:develop Sep 29, 2015
@xavfernandez
Copy link
Member

Thanks ! 👍

@rouge8 rouge8 deleted the fix-py26-home-slash branch September 29, 2015 20:22
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 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 this pull request may close these issues.

2 participants