Hi All,
It looks like the latest virtualenvs have introduced a bug creating
virtualenvs from other virtualenvs. Depending on the ownership, if
you're lucky, you'll get a permission denied error if you're lucky,
otherwise your original virtualenv will have its distutils/__init__.py
molested :-S
Steps to reproduce:
buzzkill:virtualenvs chris$ python virtualenv.py --version
1.7
buzzkill:virtualenvs chris$ python ~/LocalGIT/virtualenv/virtualenv.py
--version
1.7.2
buzzkill:virtualenvs chris$ python2.5 virtualenv.py py2.5
New python executable in py2.5/bin/python2.5
Also creating executable in py2.5/bin/python
Installing setuptools............................done.
Installing pip.....................done.
buzzkill:virtualenvs chris$ sudo -u root chown -R root py25
buzzkill:virtualenvs chris$ ./py25/bin/python2.5
~/LocalGIT/virtualenv/virtualenv.py --distribute test_2.5
Using real prefix '/System/Library/Frameworks/Python.framework/Versions/2.5'
New python executable in test_2.5/bin/python2.5
Also creating executable in test_2.5/bin/python
Overwriting test_2.5/lib/python2.5/distutils/__init__.py with new content
Traceback (most recent call last):
File "/Users/chris/LocalGIT/virtualenv/virtualenv.py", line 2429, in
<module>
main()
File "/Users/chris/LocalGIT/virtualenv/virtualenv.py", line 942, in main
never_download=options.never_download)
File "/Users/chris/LocalGIT/virtualenv/virtualenv.py", line 1045, in
create_environment
install_distutils(home_dir)
File "/Users/chris/LocalGIT/virtualenv/virtualenv.py", line 1502, in
install_distutils
writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT)
File "/Users/chris/LocalGIT/virtualenv/virtualenv.py", line 454, in
writefile
f = open(dest, 'wb')
IOError: [Errno 13] Permission denied:
'test_2.5/lib/python2.5/distutils/__init__.py'
This used to work with virtualenv 1.7:
buzzkill:virtualenvs chris$ ./py25/bin/python2.5 virtualenv.py
--distribute test_2.5
Using real prefix '/System/Library/Frameworks/Python.framework/Versions/2.5'
New python executable in test_2.5/bin/python2.5
Also creating executable in test_2.5/bin/python
Installing
distribute................................................................. ........................................................................... .................................................done.
Installing pip.....................done.
I'll log a bug for this, but does anyone have a workaround in the meantime?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk