8000 env.bat and the rest of scripts fail if there are special characters, specifically '&' · Issue #716 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

env.bat and the rest of scripts fail if there are special characters, specifically '&' #716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emelenas opened this issue Feb 10, 2019 · 1 comment

Comments

@emelenas
Copy link

The env.bat shipped with WinPython failed in my computer. I tracked down the issue to a folder in the PATH variable containing an ampersand (&).

The symptom was spyder and the rest not working, and execution of scripts\env.bat yielded

The system cannot find the path specified

The offending lines are
echo ;%PATH%; | %FINDDIR%\find.exe /C /I ";%WINPYDIR%;" >nul
if %ERRORLEVEL% NEQ 0 set PATH=%WINPYDIR%\Lib\site-packages\PyQt5;%WINPYDIR%\Lib\site-packages\PyQt4;%WINPYDIR%\Lib\site-packages\PySide2;%WINPYDIR%;%WINPYDIR%\DLLs;%WINPYDIR%\Scripts;%WINPYDIR%..\t;%WINPYDIR%..\t\mingw32\bin;%WINPYDIR%..\t\R\bin\i386;%WINPYDIR%..\t\Julia\bin;%WINPYDIR%..\t\n;%PATH%;

Enclosing the PATH variables in double quotes solved the problem, and I believe makes no harm:

echo ";%PATH%;" | %FINDDIR%\find.exe /C /I ";%WINPYDIR%;" >nul
if %ERRORLEVEL% NEQ 0 set PATH="%WINPYDIR%\Lib\site-packages\PyQt5;%WINPYDIR%\Lib\site-packages\PyQt4;%WINPYDIR%\Lib\site-packages\PySide2;%WINPYDIR%;%WINPYDIR%\DLLs;%WINPYDIR%\Scripts;%WINPYDIR%..\t;%WINPYDIR%..\t\mingw32\bin;%WINPYDIR%..\t\R\bin\i386;%WINPYDIR%..\t\Julia\bin;%WINPYDIR%..\t\n;%PATH%;"

An example of a folder name where the problem shows up is:
c:\Program Files (x86)\R&R

@stonebig
Copy link
Contributor

Good catch ! I'll apply your patch before rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0