You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KeywordResult._handle_return_value() calls itself as part of a list-comprehension if ret does not get handled by the initial if-statements:
def _handle_return_value(self, ret):
if isinstance(ret, (str, unicode, bytes)):
return self._handle_binary_result(ret)
if isinstance(ret, (int, long, float)):
return ret
if isinstance(ret, Mapping):
return dict((self._str(key), self._handle_return_value(value))
for key, value in ret.items())
try:
return [self._handle_return_value(item) for item in ret]
except TypeError:
return self._str(ret)
However, in this case ret is an object provided by a library, which happens to return itself when __getitem__ is called. _handle_return_value then enters an infinite recursion, which eventually causes the interpreter to raise a RecursionError. Should the list comprehension be inside an if-clause which checks that the object is actually a list-like object?
To get around this for now I am pickling and base64-encoding the object to a string and returning that, but that means I have to decode and de-pickle it back into an object on the client side. It would be nice if I didn't have to do this and could just return an object from my remote keyword without this issue.
The text was updated successfully, but these errors were encountered:
KeywordResult._handle_return_value()
calls itself as part of a list-comprehension ifret
does not get handled by the initial if-statements:However, in this case
ret
is an object provided by a library, which happens to return itself when__getitem__
is called._handle_return_value
then enters an infinite recursion, which eventually causes the interpreter to raise a RecursionError. Should the list comprehension be inside an if-clause which checks that the object is actually a list-like object?To get around this for now I am pickling and base64-encoding the object to a string and returning that, but that means I have to decode and de-pickle it back into an object on the client side. It would be nice if I didn't have to do this and could just return an object from my remote keyword without this issue.
The text was updated successfully, but these errors were encountered: