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
"File exists" error during venv --upgrade #65842
Comments
There seems to have been a regression in Python 3.4.1 with "pyvenv --upgrade", and this regression seems to be caused by bpo-21197. It now seems impossible to use the "--upgrade" flag without getting a "File exists" error. Steps to reproduce: $ pyvenv env
$ pyvenv --upgrade env
Error: [Errno 17] File exists: '/<pwd>/env/lib' -> '/<pwd>/env/lib64' |
I could not reproduce this in 3.4 / 3.5 [localhost 21643]$ ./python.exe Tools/scripts/pyvenv --upgrade More specific steps to reproduce it from the current codebase? |
I could reproduce the bug on the v3.4.1 tag, on the 3.4 branch and on the default branch. I think that one of the conditions for the bug to arise is to have the "lib64" symlink created (as described in bpo-21197). I reproduced the bug on Gentoo and Arch environments. |
Full traceback (I modified venv/main.py): haypo@smithers$ /opt/py34/bin/python3 -m venv --upgrade ENV
Error: [Errno 17] File exists: '/home/haypo/ENV/lib' -> '/home/haypo/ENV/lib64'
Traceback (most recent call last):
File "/opt/py34/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/opt/py34/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/opt/py34/lib/python3.4/venv/__main__.py", line 6, in <module>
main()
File "/opt/py34/lib/python3.4/venv/__init__.py", line 438, in main
builder.create(d)
File "/opt/py34/lib/python3.4/venv/__init__.py", line 82, in create
context = self.ensure_directories(env_dir)
File "/opt/py34/lib/python3.4/venv/__init__.py", line 147, in ensure_directories
os.symlink(p, link_path)
FileExistsError: [Errno 17] File exists: '/home/haypo/ENV/lib' -> '/home/haypo/ENV/lib64' It looks like a regression introduced by the issue bpo-21197. Attached patch should fix it. |
Oh, my test lacks a unit test! |
Ok, this bug is a regression introduced in Python 3.4.1. |
New changeset 27e1b4a9de07 by Vinay Sajip in branch '3.4': New changeset 71eda9bd8875 by Vinay Sajip in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: