Issue #162 resolved

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

Radu Voicilas avatarRadu 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

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.