Skip to content

Conversation

@yurirocha15
Copy link
Contributor

When testing the changes in #108 using python3, I encountered the following error:

ERROR: Doxygen of package [] failed: write() argument must be str, not bytes
Traceback (most recent call last):
  File "<string>", line 194, in generate_docs
  File "rosdoc_lite/src/rosdoc_lite/doxygenator.py", line 263, 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 "rosdoc_lite/src/rosdoc_lite/doxygenator.py", line 186, in package_doxygen_template
    tagfiles = prepare_tagfiles(rd_config['tagfile_spec'], tagfile_dir, output_subfolder)
  File "rosdoc_lite/src/rosdoc_lite/doxygenator.py", line 140, in prepare_tagfiles
    tagfile.write(ret.read())
TypeError: write() argument must be str, not bytes

I believe I could not catch this on #108 unit tests because I was using a mock file, which seems not to raise any errors on write.

To fix this issue, I added a string decode logic before saving it to the file. As python2 does not have bytes I left the python 2 version as is.

@tfoote Sorry for not validating this before #108 was merged.

Copy link
Member

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick follow-up

@tfoote tfoote merged commit ddd0835 into ros-infrastructure:master Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants