Check return value of Python functions that can fail
See original GitHub issueThis is a tracking ticket for checking return values in rclpy. These functions are used and can fail, but their return value is not being checked.
-
PyList_New
-
PyCapsule_New
-
PyLong_FromUnsignedLongLong
-
PyMem_Malloc
-
PyUnicode_FromString
-
PyLong_FromSize_t
-
PyObject_GetAtterString
-
PyLong_FromLongLong
-
PyCapsule_GetName
-
PyList_Append
-
PyObject_CallObject
-
PyTuple_New
-
PyTuple_SetItem
-
PyList_SetItem
-
PyImport_ImportModule
-
PyObject_SetAttrString
From discussion here https://github.com/ros2/rclpy/pull/138#discussion_r148367820 https://github.com/ros2/rclpy/pull/138#discussion_r148363958
Labeling this as good first issue
. This doesnt imply that a contribution for this should tackle all the functions listed above
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Python Return Error From Function - Finxter
To return an error from a Python function, don't use dummy values such as return -1 or return None . Instead, use the...
Read more >How do I detect in python if the type of return value if it is an Error
Without knowing the context of what you want to accomplish, you can use isinstance(return_value, Exception) . It should do what you are ...
Read more >The Python return Statement: Usage and Best Practices
The return value of a Python function can be any Python object. Everything in Python is an object. So, your functions can return...
Read more >Do I raise or return errors in Python? - victoria.dev
Raise can help you avoid writing functions that fail silently. For example, this code will not raise an exception if JAM doesn't exist:....
Read more >Exception Handling — Python 3.11.1 documentation
Return value : Always NULL. Part of the Stable ABI. This function sets the error indicator and returns NULL . exception should be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sloretz Hello, I’m new to open source and love working with ros. How can I approach this issue?
I would like to help with this one @sloretz should I proceed?