question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Check return value of Python functions that can fail

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
pr-dbcommented, Aug 12, 2021

@sloretz Hello, I’m new to open source and love working with ros. How can I approach this issue?

1reaction
suab321321commented, Aug 17, 2019

I would like to help with this one @sloretz should I proceed?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found