8000 Parentheses in path name breaks env.bat, stops Spyder.exe and other commands from running · Issue #375 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

Parentheses in path name breaks env.bat, stops Spyder.exe and other commands from running #375

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
jokfish opened this issue Aug 15, 2016 · 5 comments

Comments

@jokfish
Copy link
jokfish commented Aug 15, 2016

Symptoms are that double clicking Spyder.exe just does nothing.

In WinPython-64bit-3.5.2.1Qt5 (and I believe other 3.4 and 3.5s) the test for R and Julia directories is done with the section

if exist "%WINPYDIR%\..\tools\R\bin" (
    set R_HOME=%WINPYDIR%\..\tools\R
    if "%WINPYARCH%"=="WIN32" (
        set R_HOMEbin=%R_HOME%\bin\i386
    ) else (
        set R_HOMEbin=%R_HOME%\bin\x64
    )
)

Which fails with the following error if there are any parentheses (specifically round brackets) in the path name;
\WinPython-64bit-3.5.2.1Qt5\scripts\..\python-3.5.2.amd64\..\tools\R was unexpected at this time.

In WinPython-64bit-2.7.9.5 this test was done with an 'if NOT exist' statement, which seemed to catch this error

if not exist "%WINPYDIR%\..\tools\R\bin" goto r_bad
set R_HOME=%WINPYDIR%\..\tools\R
if %WINPYARCH%=="WIN32"     set R_HOMEbin=%R_HOME%\bin\i386
if not %WINPYARCH%=="WIN32" set R_HOMEbin=%R_HOME%\bin\x64
:r_bad

I have tried copying the method into the 3.5.2.1 env.bat and have confirmed that it fixes the problem.

if not exist "%WINPYDIR%\..\tools\R\bin" goto r_bad
set R_HOME=%WINPYDIR%\..\tools\R
if "%WINPYARCH%"=="WIN32" (
    set R_HOMEbin=%R_HOME%\bin\i386
) else (
    set R_HOMEbin=%R_HOME%\bin\x64
)
:r_bad

Although it's only a work around, because I'm guessing it doesn't solve the problem where the directory has parentheses in the name AND R or Julia exist.

Thanks to everyone who has put so much work into this great package.

@stonebig
Copy link
Contributor
stonebig commented Aug 15, 2016

Can you give an example of a path name with (specifically round brackets), so I'm sure to understand ?

The "(" / ")" way of writing DOS was making it less of a pain to read.... shame

@stonebig
Copy link
Contributor
stonebig commented Aug 15, 2016

so, something safety-belted like that:

rem ******************
rem handle R if included
rem ******************
if not exist "%WINPYDIR%\..\tools\R\bin" goto r_bad
set R_HOME=%WINPYDIR%\..\tools\R
if     "%WINPYARCH%"=="WIN32" set R_HOMEbin=%R_HOME%\bin\i386
if not "%WINPYARCH%"=="WIN32" set R_HOMEbin=%R_HOME%\bin\x64
:r_bad

rem ******************
rem handle Julia if included
rem ******************
if not exist "%WINPYDIR%\..\tools\Julia\bin" goto julia_bad
set JULIA_HOME=%WINPYDIR%\..\tools\Julia\bin\
set JULIA_EXE=julia.exe
set JULIA=%JULIA_HOME%%JULIA_EXE%
set JULIA_PKGDIR=%WINPYDIR%\..\settings\.julia
:julia_bad

the other places where " ) else (" is used are between doublequotes, so safe from the problem I suppose.

@jokfish
Copy link
Author
jokfish commented Aug 15, 2016

When I was testing I used the folder c:/tmp/(tmp)/ to verify it wasn't path length.

That second section of code you posted looks better, were you able to replicate the problem?

The DOS was so ugly I couldn't get my head around it, offended my spoilt eyes that are so used to looking at Python ;)

@stonebig
Copy link
Contributor
stonebig commented Aug 15, 2016

testing the fix, so it's in coming build.

@stonebig
Copy link
Contributor

#376

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

No branches or pull requests

2 participants
0