Home Help Center

Strange path effect for Ice.loadSlice with network share path

degloffdegloff Member Daniel EgloffOrganization: QuantAlea GmbHProject: Financial derivative pricing
We are using Python to load slice definitions from a network share.

Consider the following snippet:


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:


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
RuntimeError: Slice preprocessing failed for `--all -I"\\srv-s317\Grid\InstanceV1.0\slice"

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.



  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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.
  • degloffdegloff Member Daniel EgloffOrganization: QuantAlea GmbHProject: Financial derivative pricing
    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
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    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.

Sign In or Register to comment.