Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Paths containing special characters are not handled by batch files on Windows #351

Closed
piotr-dobrogost opened this Issue · 1 comment

1 participant

@piotr-dobrogost

Below is example of PYTHONHOME not being correctly restored after virtualenv's deactivation. However the problem is broader as batch files in the project do not use extended syntax of set command thus they can't handle paths containing special characters (parentheses in this case). Using extended syntax of set command also takes care of paths containing spaces and would allow to correct (incorrect as described in issue #126 and noted by @dabrahams) fix applied in commit aee741c.

c:\>where python
c:\Program Files\Python\2.7\python.exe
c:\Program Files\Python\2.7\Scripts\python.bat

c:\>mklink /d () "c:\Program Files\Python\2.7"
symbolic link created for () <<===>> c:\Program Files\Python\2.7

c:\>set PATH=c:\();%PATH%

c:\>where python
c:\()\python.exe
c:\Program Files\Python\2.7\python.exe
c:\Program Files\Python\2.7\Scripts\python.bat

c:\>set PYTHONHOME=c:\()

c:\>virtualenv c:\venv
PYTHONHOME is set.  You *must* activate the virtualenv before using it
New python executable in c:\venv\Scripts\python.exe
Installing distribute............................................................................................................................................................................................................done.
Installing pip..................done.

c:\>venv\Scripts\activate.bat
(venv) c:\>echo %_OLD_VIRTUAL_PYTHONHOME%
c:\(

(venv) c:\>deactivate
c:\>echo %PYTHONHOME%
c:\(
@piotr-dobrogost piotr-dobrogost referenced this issue from a commit in piotr-dobrogost/virtualenv
@piotr-dobrogost piotr-dobrogost Use extended syntax of `set` command which handles special characters…
… in variable's value. Fixes issue #351
716ce62
@piotr-dobrogost

Fixed in merged pull request #352

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.