Home Bug Reports

python: Ice.initialize with initialization data fails

hiaslhiasl Member Matthias WeberOrganization: University of Erlangen-NurembergProject: This baby is still nameless
Hi,

the example on page 733, v.3.1.1 fails:

props = Ice.createProperties(sys.argv)
props.setProperty("Ice.Trace.Network", "0")
props.setProperty("Ice.Trace.Protocol", "0")
id = Ice.InitializationData()
id.properties = props
ic = Ice.initialize(id)

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/projects/packages/ice/python/Ice.py", line 271, in initialize
communicator = IcePy.Communicator(args, data)
TypeError: argument 1 must be list, not InitializationData

Since python has no overloaded methods, the correct way seems to be:

props = [
"Ice.Trace.Network", "0",
"Ice.Trace.Protocol", "0"
]
ic = Ice.initialize(props)

Bye,
Matthias

Comments

  • dwaynedwayne St. John's, NewfoundlandMember Dwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine
    Hi,

    The call to initialize should be the following

    ic = Ice.initialize(sys.argv, id)

    Thanks for reporting this.

    Regards,
    Dwayne
Sign In or Register to comment.