ros-infrastructure / rosdoc_lite

A light-weight version of rosdoc that does not rely on ROS infrastructure for crawling packages.
10 stars 31 forks source link

rosdoc_lite crashing on ROS Noetic when using tags with URLs #107

Closed yurirocha15 closed 2 months ago

yurirocha15 commented 5 months ago

Issue

When running rosdoc_lit using a tag file containing URLs, the following error happens:

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rosdoc_lite/__init__.py", line 194, in generate_docs
    plugin(path, package, manifest, build_params[plugin_name], html_dir, quiet)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosdoc_lite/doxygenator.py", line 251, in generate_doxygen
    doxy = package_doxygen_template(doxy_template, rd_config, path, package, html_dir, header_file.name, footer_file.name, manifest_dir, tagfile_dir, output_subfolder)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosdoc_lite/doxygenator.py", line 174, in package_doxygen_template
    tagfiles = prepare_tagfiles(rd_config['tagfile_spec'], tagfile_dir, output_subfolder)
  File "/opt/ros/noetic/lib/python3/dist-packages/rosdoc_lite/doxygenator.py", line 119, in prepare_tagfiles
    import urllib2
ModuleNotFoundError: No module named 'urllib2'

The culprit is this line. As stated in the urllib2 documentation, urllib2 does not exist on python3 (it was renamed to urllib).

How to Reproduce

Create a tags.yaml file with urls, for example:

- docs_url: http://docs.ros.org/en/noetic/api/moveit_ros/html
  location: http://docs.ros.org/en/noetic/symbols/moveit_ros.tag
  package: moveit_ros

Run:

$ rosdoc_lite -o ./doc/my_package -t ./tags.yaml my_package
yurirocha15 commented 3 months ago

@tfoote could you take a look at this issue? Thanks.