Skip to content

Repeated calls to env.bat fill up PATH var #310

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
dougthor42 opened this issue Apr 6, 2016 · 3 comments · Fixed by #311
Closed

Repeated calls to env.bat fill up PATH var #310

dougthor42 opened this issue Apr 6, 2016 · 3 comments · Fixed by #311

Comments

@dougthor42
Copy link
Contributor

Summary

Repeated calls to env.bat will append duplicate items to PATH and eventually overflow.

Steps to Reproduce:

  1. Open up WinPython Command Prompt
  2. cd <WinPython_Dir>/scripts/
  3. execute env.bat multiple times (13 seems to do the trick for WinPython34, 17 for WinPython27)
  4. Error occurs.

Tested on

  • WinPython 3.4.3.2, 64-bit
  • WinPython 2.7.3 2.7.6.2, 32-bit

More information

  • Seems like it could be solved by adding a check for the PATH var, in a similar vein to this StackOverflow anwer
  • For anyone interested in attempting to fix this: the env.bat file is created in winpython/make.py, line 549.

Images

Steps to Reproduce

image

PATH environment variable gets filled up

image

@stonebig
Copy link
Contributor

stonebig commented Apr 7, 2016

try to modify env.bat "set PATH" line as follow, and let me know:

BEFORE:

set PATH=%WINPYDIR%\Lib\site-packages\PyQt5;%WINPYDIR%\Lib\site-packages\PyQt4;%WINPYDIR%\;%WINPYDIR%\DLLs;%WINPYDIR%\Scripts;%WINPYDIR%\..\tools;%WINPYDIR%\..\tools\mingw32\bin;%WINPYDIR%\..\tools\R\bin\i386;%WINPYDIR%\..\tools\Julia\bin;%PATH%;

AFTER

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

@dougthor42
Copy link
Contributor Author

That looks like it worked, thanks.

Checked on both versions that I have.

Do you want me to submit a PR for the change or will you guys fix it on your own?

@stonebig
Copy link
Contributor

stonebig commented Apr 7, 2016

a PR is welcomed. It will be merged for next release, no this one, so will be pending 10 days (unless current RC is found faulty)

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

Successfully merging a pull request may close this issue.

2 participants