ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
173 stars 160 forks source link

removeprefix breaks compatibility with source builds on Nvidia Jetson #909

Open robmasocco opened 3 months ago

robmasocco commented 3 months ago

Bug report

Required Info:

Steps to reproduce issue

ros2 topic list

Expected behavior

Issued command works.

Actual behavior

Traceback (most recent call last):
  File "/opt/ros/humble/install/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.10', 'console_scripts', 'ros2')())
  File "/opt/ros/humble/install/lib/python3.8/site-packages/ros2cli/cli.py", line 91, in main
    rc = extension.main(parser=parser, args=args)
  File "/opt/ros/humble/install/lib/python3.8/site-packages/ros2topic/command/topic.py", line 41, in main
    return extension.main(args=args)
  File "/opt/ros/humble/install/lib/python3.8/site-packages/ros2topic/verb/list.py", line 55, in main
    with NodeStrategy(args) as node:
  File "/opt/ros/humble/install/lib/python3.8/site-packages/ros2cli/node/strategy.py", line 35, in __init__
    spawn_daemon(args)
  File "/opt/ros/humble/install/lib/python3.8/site-packages/ros2cli/node/daemon.py", line 148, in spawn_daemon
    fdlimit = int(line.removeprefix(string_to_find).strip())
AttributeError: 'str' object has no attribute 'removeprefix'

Additional information

Humble Hawksbill source builds are possible on Nvidia Jetson boards using JetPack 5.x, which is based on Ubuntu 20.04. JetPack 5.x's Python version is 3.8, but removeprefix was added in Python version 3.9.

clalancette commented 3 months ago

Humble Hawksbill source builds are possible on Nvidia Jetson boards using JetPack 5.x, which is based on Ubuntu 20.04. JetPack 5.x's Python version is 3.8, but removeprefix was added in Python version 3.9.

Please feel free to open a PR targeting humble to fix it, we're happy to review.