[issue15776] Allow pyvenv to work in existing directory

Vinay Sajip report at bugs.python.org
Fri Aug 24 14:17:44 CEST 2012


Vinay Sajip added the comment:

Running

pyvenv --clear .

should work, but doesn't because of the way the venv directory is initialised - a shutil.rmtree() call is used. This can cause problems on Windows (current directory is regarded as open and so cannot be deleted) and also on Posix, because the inode changes and you get "file not found" errors because e.g. the shell has pointers to the old inode and the venv files are added to the new inode.

The attached patch should work, as it deletes the venv directory contents rather than the venv directory itself. I'll just check with Georg that it's OK to commit this - I don't see any problem, as it's a bug-fix rather than a new feature, but I think it best to run it past him.

----------
keywords: +patch
nosy: +georg.brandl
Added file: http://bugs.python.org/file26983/pyvenv.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15776>
_______________________________________


More information about the Python-bugs-list mailing list