Task #11989 (closed)
BUG: bin\omero doesn't like spaces in the ice system path
Reported by: | spli | Owned by: | bpindelski |
---|---|---|---|
Priority: | minor | Milestone: | 5.1.0-m1 |
Component: | OmeroPy | Version: | 5.0.0-rc1 |
Keywords: | n.a. | Cc: | |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | n.a. |
Description
The default install location for Ice-3.4.2 on Windows is
c:\Program Files (x86)\ZeroC\Ice-3.4.2
With
PATH=c:\Python26;c:\Program Files (x86)\ZeroC\Ice-3.4.2\bin\x64;%PATH%
and
PYTHONPATH=c:\Program Files (x86)\ZeroC\Ice-3.4.2\python\x64
Ice and Python work fine but omero fails:
C:\OMERO.server-5.0.0-rc2-ice34-b14>echo %PYTHONPATH% c:\Program Files (x86)\ZeroC\Ice-3.4.2\python\x64 C:\OMERO.server-5.0.0-rc2-ice34-b14>python -c "import Ice" C:\OMERO.server-5.0.0-rc2-ice34-b14>bin\omero \ZeroC\Ice-3.4.2\python\x64`) was unexpected at this time.
Change History (6)
comment:1 Changed 10 years ago by bpindelski
- Cc python-team@… removed
- Owner set to bpindelski
comment:2 Changed 10 years ago by bpindelski
comment:3 Changed 10 years ago by bpindelski
Looking at the main omero script, the path is being set properly (see https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/bin/omero#L74). The only changes needed are on the branch https://github.com/bpindelski/openmicroscopy/tree/11989_omero_bat.
comment:4 Changed 10 years ago by bpindelski
- Resolution set to fixed
- Status changed from new to closed
comment:5 Changed 10 years ago by Blazej Pindelski <bpindelski@…>
- Remaining Time set to 0
(In [29ec7a64a257394a8464594f1cd3028d0572d37e/ome.git] on branch develop) Fix #11989: set PYTHONPATH once on Windows.
comment:6 Changed 10 years ago by Josh Moore <josh@…>
(In [252211d7835c94d57992cf7d405fbfcb294730f2/ome.git] on branch develop) Merge pull request #2174 from bpindelski/11989_omero_bat
Fix PYTHONPATH whitespace issue on Windows (see #11989).
The cause of the problem described in this ticket lies in the setpythonpath.bat file. It's meant to modify the PYTHONPATH and prefix it with the path of the lib\python directory (e.g. if bin\omero is being executed from the C:\OMERO.server directory, then PYTHONPATH will get prefixed with C:\OMERO.server\lib\python). The script checks if the prefix exists - if yes, then it doesn't do anything. This script is invoked inside omero.bat, which is the entry point on Windows.
I've spent 6 hours trying to figure out how to force cmd.exe to work nicely with spaces in path names (culprit here being the Ice installation path that ends up on PYTHONPATH). It borders on masochism. If there isn't any strong reason for keeping the setpythonpath.bat file around, I'd vote for moving the logic into the main omero Python file and modifying the PYTHONPATH there.