Archived
This forum has been archived. Please start a new discussion on GitHub.
python: Ice.initialize with initialization data fails
in Bug Reports
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
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
0
Comments
-
Hi,
The call to initialize should be the following
ic = Ice.initialize(sys.argv, id)
Thanks for reporting this.
Regards,
Dwayne0