Archived

This forum has been archived. Please start a new discussion on GitHub.

Strange path effect for Ice.loadSlice with network share path

We are using Python to load slice definitions from a network share.

Consider the following snippet:

Demo.py:

import sys, os, random, Ice, IceStorm
IceSliceDir = Ice.getSliceDir()
sliceDir = r"\\srv-s317\Grid\InstanceV1.0\slice"
loadSliceStr = "--all -I\"" + sliceDir + "\" -I\"" + IceSliceDir + "\" \"" + sliceDir + "\\Grid.ice\""
print "loadSliceStr:", loadSliceStr
Ice.loadSlice(loadSliceStr) # line 10

When I start the script I get the following effect:

C:\Local\vtbuild>\\srv-s317\Grid\InstanceV1.0\Demo.py

loadSliceStr: --all -I"\\srv-s317\Grid\InstanceV1.0\slice" -I"\\srv-s317\Grid\InstanceV1.0\Ice-3.5.0-py26\slice" "\\srv-s317\Grid\InstanceV1.0\slice\Grid.ice"

icecpp: error: cannot open `C:/Local/vtbuild/srv-s317/frontarenaexport/Grid/InstanceV1.0/slice/Grid.ice' for reading
Traceback (most recent call last):
File "\\srv-s317\Grid\InstanceV1.0\Demo.py", line 10, in
<module>
Ice.loadSlice(loadSliceStr)
RuntimeError: Slice preprocessing failed for `--all -I"\\srv-s317\Grid\InstanceV1.0\slice"
-I"\\srv-s317\Grid\InstanceV1.0\Ice-3.5.0-py26\slice"
"\\srv-s317\Grid\InstanceV1.0\slice\Grid.ice"'


loadSlice somehow modifies the path: `C:/Local/vtbuild/srv-s317/....

Do we do something wrong?

We use Ice 3.5.0 on Windows 7 64 bit.

Many thanks for any help or feedback.

Daniel

Comments

  • xdm
    xdm La Coruña, Spain
    Hi Daniel,

    Seems a problem with MCPP C++ preprocessor used by Ice, when the network path is in quotes like in your case the preprocessor doesn't correctly open the file.

    To workaround the issue you can avoid quotes in the Slice file, which should work if you don't have white spaces in it, or you can map the network resource to a network drive and use the drive in the path.
  • Hi Jose

    Thanks for the tip. Yes, removing the quotes solves the problem. Fortunately our path does not have white space. For other users that may be a problem.

    I guess you file that as a bug report?

    Regards, Daniel
  • benoit
    benoit Rennes, France
    Hi,

    If the path contains white spaces, you can surround the path with single quotes instead of the double quotes, it should work. When Ice for Python parses the Ice.loadSlice argument it splits the options according to bash quoting rules. Bash quoting rules specify that two backslash characters are replaced with a single backslash when enclosed in double quotes... unlike when using single quotes where the 2 backslash characters are preserved.

    Cheers,
    Benoit.