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

regression in virtualenv 15.0.2: --clear no longer works on Windows #929

Closed
glyph opened this issue Jun 3, 2016 · 2 comments · Fixed by #937
Closed

regression in virtualenv 15.0.2: --clear no longer works on Windows #929

glyph opened this issue Jun 3, 2016 · 2 comments · Fixed by #937

Comments

@glyph
Copy link

glyph commented Jun 3, 2016

The tcl/tk "fix" (which there appears to be no way to disable?) has caused --clear to start raising an exception; sample traceback here

Deleting tree C:\Users\BUILDS~1\BOT-GL~1\WINDOW~1.7-S\venv\Lib
Not deleting C:\Users\BUILDS~1\BOT-GL~1\WINDOW~1.7-S\venv\Scripts
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\site-packages\virtualenv.py", line 2332, in <module>
    main()
  File "C:\Python27\lib\site-packages\virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "C:\Python27\lib\site-packages\virtualenv.py", line 924, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "C:\Python27\lib\site-packages\virtualenv.py", line 1136, in install_python
    copy_tcltk(prefix, home_dir, symlink)
  File "C:\Python27\lib\site-packages\virtualenv.py", line 1077, in copy_tcltk
    copyfileordir(srcdir, dstdir, symlink)
  File "C:\Python27\lib\site-packages\virtualenv.py", line 327, in copyfileordir
    shutil.copytree(src, dest, symlink)
  File "C:\Python27\lib\shutil.py", line 177, in copytree
    os.makedirs(dst)
  File "C:\Python27\lib\os.py", line 157, in makedirs
    mkdir(name, mode)
WindowsError: [Error 183] Cannot create a file when that file already exists: 'C:\\Users\\BUILDS~1\\BOT-GL~1\\WINDOW~1.7-S\\venv/tcl/tcl8.5'

This broke all of Twisted's buildbots when we upgraded.

glyph added a commit to twisted-infra/braid that referenced this issue Jun 3, 2016
@u8sand
Copy link

u8sand commented Jun 3, 2016

A similar regression happens on creating a virtualenv. But I get something along the lines of Directory does not exist '.../python\\tcl/tcl8.5', and indeed this directory doesn't even exist in my Windows python installation.

@rodcloutier
Copy link

Similar regression when trying to reinstall a virtualenv in a folder already containing a virtualenv.

$ virtualenv --version
15.0.1

$ virtualenv venv/test
Overwriting C:\dev\git\venv\test\lib\orig-prefix.txt with new content
New python executable in C:\dev\git\venv\test\Scripts\python.exe
Installing setuptools, pip, wheel...done.

$ virtualenv venv/test
New python executable in C:\dev\git\venv\test\Scripts\python.exe
Installing setuptools, pip, wheel...done.

$ pip install -U virtualenv===15.0.2
Collecting virtualenv===15.0.2
  Downloading https://root/pypi/+f/832/cc0a303e61fa7/virtualenv-15.0.2-py2.py3-none-any.whl (1.8MB)
    100% |################################| 1.8MB 2.3MB/s
Installing collected packages: virtualenv
  Found existing installation: virtualenv 15.0.1
    Uninstalling virtualenv-15.0.1:
      Successfully uninstalled virtualenv-15.0.1
Successfully installed virtualenv-15.0.2

$ virtualenv venv/test
Traceback (most recent call last):
  File "f:\bin\python\278\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "f:\bin\python\278\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "F:\bin\Python\278\scripts\virtualenv.exe\__main__.py", line 9, in <module>
  File "f:\bin\python\278\lib\site-packages\virtualenv.py", line 711, in main
    symlink=options.symlink)
  File "f:\bin\python\278\lib\site-packages\virtualenv.py", line 924, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "f:\bin\python\278\lib\site-packages\virtualenv.py", line 1136, in install_python
    copy_tcltk(prefix, home_dir, symlink)
  File "f:\bin\python\278\lib\site-packages\virtualenv.py", line 1077, in copy_tcltk
    copyfileordir(srcdir, dstdir, symlink)
  File "f:\bin\python\278\lib\site-packages\virtualenv.py", line 327, in copyfileordir
    shutil.copytree(src, dest, symlink)
  File "f:\bin\python\278\lib\shutil.py", line 177, in copytree
    os.makedirs(dst)
  File "f:\bin\python\278\lib\os.py", line 157, in makedirs
    mkdir(name, mode)
WindowsError: [Error 183] Cannot create a file when that file already exists: 'C:\\dev\\git\\venv\\test/tcl/tcl8.5'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants