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

virtualenv shouldn't fatal if lock directory isn't writable #1640

Closed
legoktm opened this issue Feb 15, 2020 · 2 comments
Closed

virtualenv shouldn't fatal if lock directory isn't writable #1640

legoktm opened this issue Feb 15, 2020 · 2 comments

Comments

@legoktm
Copy link

legoktm commented Feb 15, 2020

Traceback/reproduction steps:
https://gist.github.com/legoktm/533669e450d0f5f41838a4e9b858d774

By default the lock directory seems to be ~/.local/share/..., but this is problematic in our setup, where our home directory is set to /nonexistent.

Wouldn't it be better to store temporary lock files in a temporary directory aka /tmp (and its equivalents on other OS's)?

Also, I don't expect the lack of a writable directory to fail so hard. You can't even get virtualenv --help to work:

nobody@4b70ed23eebd:/src/apt-browser$ /src/apt-browser/.tox/.tox/bin/python -m virtualenv --help
FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/.local/share/virtualenv/py-info/20.0.4/2d7075eda06572014a3dfd447e6915f0dadc794767f53ba9bc4e3ed19eeb098d.lock'
wmfgerrit pushed a commit to wikimedia/integration-zuul-config that referenced this issue Feb 15, 2020
To workaround a virtualenv 20 bug: <pypa/virtualenv#1640>

Change-Id: I58dc7ce30399410910423fc1f6faf2b0993f7c56
@gaborbernat
Copy link
Contributor

This would make sense 👍 I'll add it as an enhancement request.

yakkle added a commit to yakkle/virtualenv that referenced this issue Feb 25, 2020
 - when using docker, if `user_data_dir()` isn't writable directory,
   `default_data_dir()` use `system temp directory` + `virtualenv`.
   for example, tempdir is `/tmp`, it use `/tmp/virtualenv`
yakkle added a commit to yakkle/virtualenv that referenced this issue Feb 25, 2020
 - when using docker, if `user_data_dir()` isn't writable directory,
   `default_data_dir()` use `system temp directory` + `virtualenv`.
   for example, tempdir is `/tmp`, it use `/tmp/virtualenv`
gaborbernat pushed a commit to yakkle/virtualenv that referenced this issue Feb 25, 2020
 - when using docker, if `user_data_dir()` isn't writable directory,
   `default_data_dir()` use `system temp directory` + `virtualenv`.
   for example, tempdir is `/tmp`, it use `/tmp/virtualenv`
gaborbernat added a commit that referenced this issue Feb 26, 2020
* fixed FileNotFoundError when directory isn't writable (#1640)

 - when using docker, if `user_data_dir()` isn't writable directory,
   `default_data_dir()` use `system temp directory` + `virtualenv`.
   for example, tempdir is `/tmp`, it use `/tmp/virtualenv`

* start making the app-data more explicit and robust

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>

* fix Windows

* fix docs

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
@gaborbernat
Copy link
Contributor

Hello, a fix for this issue has been released via virtualenv 20.0.6; see https://pypi.org/project/virtualenv/20.0.6/ (https://virtualenv.pypa.io/en/latest/changelog.html#v20-0-6-2020-02-26) . Please give a try and report back if your issue has not been addressed; if not, please comment here, and we'll reopen the ticket. We want to apologize for the inconvenience this has caused you and say thanks for having patience while we resolve the unexpected bugs with this new major release.
thanks

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants