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 <rep...@bugs.python.org>
<http://bugs.python.org/issue15776>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to