Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling a method with no arguments causes a TypeError #963

Open
craigh92 opened this issue Feb 18, 2020 · 1 comment
Open

Calling a method with no arguments causes a TypeError #963

craigh92 opened this issue Feb 18, 2020 · 1 comment

Comments

@craigh92
Copy link

Error

press any key to exitERROR:opcua.server.address_space:Error executing method call CallMethodRequest(ObjectId:FourByteNodeId(ns=2;i=26), MethodId:FourByteNodeId(ns=2;i=27), InputArguments:None), an exception was raised: 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/opcua/server/address_space.py", line 466, in _call
    result = node.call(method.ObjectId, *method.InputArguments)
TypeError: wrapper() argument after * must be an iterable, not NoneType

Cause

This is because line 466 expects an iterable:

result = node.call(method.ObjectId, *method.InputArguments)

Fix

This can be fixed by passing in an empty array if there are no input arguments:

if method.InputArguments is None:
    method.InputArguments = []             
result = node.call(method.ObjectId, *method.InputArguments)
@craigh92
Copy link
Author

Fixed in Open Merge Request #964

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant