Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of installer version strings #776

Conversation

christophebedard
Copy link
Member

The --all-versions option currently fails:

0.19.0

ERROR: Rosdep experienced an error: a bytes-like object is required, not 'str'
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://www.ros.org/wiki/rosdep

rosdep version: 0.19.0

Traceback (most recent call last):
  File "/home/chris/rosdep/src/rosdep2/main.py", line 144, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/home/chris/rosdep/src/rosdep2/main.py", line 389, in _rosdep_main
    installer_version_strings = installer.get_version_strings()
  File "/home/chris/rosdep/src/rosdep2/platforms/debian.py", line 266, in get_version_strings
    version = output.splitlines()[0].split(' ')[1]
TypeError: a bytes-like object is required, not 'str'

I assume this (change to bytes) wasn't caught during the move to Python 3.

I also checked the other implementations of get_version_strings() and added calls to decode() where necessary. Otherwise it prints out b'1.2.3' instead of 1.2.3. I haven't tested nix or opkg, but it works fine for gem and apt-get.

@codecov-commenter
Copy link

codecov-commenter commented Aug 21, 2020

Codecov Report

Merging #776 into master will decrease coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #776      +/-   ##
==========================================
- Coverage   74.84%   74.81%   -0.04%     
==========================================
  Files          41       41              
  Lines        3220     3220              
==========================================
- Hits         2410     2409       -1     
- Misses        810      811       +1     
Impacted Files Coverage Δ
src/rosdep2/platforms/debian.py 79.24% <0.00%> (ø)
src/rosdep2/platforms/gem.py 78.37% <0.00%> (ø)
src/rosdep2/platforms/nix.py 83.33% <0.00%> (ø)
src/rosdep2/platforms/openembedded.py 78.26% <0.00%> (ø)
src/rosdep2/shell_utils.py 97.72% <0.00%> (-2.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2667916...efb5224. Read the comment docs.

Copy link
Contributor

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

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

Thanks very much!

@nuclearsandwich nuclearsandwich merged commit fdaea3a into ros-infrastructure:master Nov 12, 2020
@christophebedard christophebedard deleted the fix-installer-version-bytes branch November 12, 2020 20:26
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.

3 participants