ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
166 stars 158 forks source link

Incompatibility of humble with python3.6: `signals.valid_signals()` #879

Closed christophfroehlich closed 5 months ago

christophfroehlich commented 5 months ago

Bug report

https://github.com/ros2/ros2cli/pull/639 introduced an incompatibility with python 3.6, which is the minimum requirement for humble and default on rhel 8.

I'm not proficient enough with python, maybe there is a workaround for this to make it compatible with python 3.6

Required Info:

Steps to reproduce issue

Run tests for ros2_control

Expected behavior

no error

Actual behavior

8: Traceback (most recent call last):
8:   File "/opt/ros/humble/bin/ros2", line 11, in <module>
8:     load_entry_point('ros2cli==0.18.7', 'console_scripts', 'ros2')()
8:   File "/opt/ros/humble/lib/python3.6/site-packages/ros2cli/cli.py", line 89, in main
8:     rc = extension.main(parser=parser, args=args)
8:   File "/opt/ros/humble/lib/python3.6/site-packages/ros2run/command/run.py", line 70, in main
8:     return run_executable(path=path, argv=args.argv, prefix=prefix)
8:   File "/opt/ros/humble/lib/python3.6/site-packages/ros2run/api/__init__.py", line 73, in run_executable
8:     if -process.returncode in signal.valid_signals() and os.name == 'posix':
8: AttributeError: module 'signal' has no attribute 'valid_signals'

Additional information

valid_signals() was introduced with python 3.8: https://docs.python.org/3/library/signal.html#signal.valid_signals

clalancette commented 5 months ago

In all honesty, that code is just for printing out nicer error messages. We could go ahead and just make it conditional on valid_signals existing, only for Humble (we don't have this problem on Iron and later since we updated to RHEL-9). I'll open a PR to humble to do that.

christophfroehlich commented 5 months ago

Thanks for the immediate response!

cottsay commented 5 months ago

Fix was released with 0.18.9.