Issue #162 resolved

mkvirtualenv clobbers virtualenv's --python option when a relative path is passed in

Radu Voicilas
created an issue

I think mkvirtualenv changes the working directory right before running the virtualenv command and it somehow breaks the --python switch with a relative path. Here's an example:

$ mkvirtualenv --python .pythonz/pythons/CPython-2.7.3/bin/python test

The executable /home/raduv/.virtualenvs/.pythonz/pythons/CPython-2.7.3/bin/python (from --python=.pythonz/pythons/CPython-2.7.3/bin/python) does not exist

I think the issue is somewhere around line 427, where virtualenvwrapper_cd is called. Maybe the $@ should be parsed and all relative paths should be made absolute before changing the current directory ?

Anyways, I am open to providing a patch to this, but I'll have to revise my shell scripting fu, so until then maybe someone else can take a look.

Comments (3)

  1. Radu Voicilas reporter

    Well, alright, I have a small patch but I'm not really happy with it because of several reasons:

    -- if realpath fails, virtualenvwrapper should exit and stop creating the environment

    -- the whole if [ ! -z $interpreter ] thing seems a good candidate for a virtualenvwrapper_update_args function

  2. Log in to comment