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

Small fixes for roslaunch-check on Python 3. #1770

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

mikepurvis
Copy link
Member

Stuff that came up in the course of our migration work.

@@ -113,14 +113,14 @@ if __name__ == '__main__':

if error_msg:
print("FAILURE:\n%s"%error_msg, file=sys.stderr)
with open(test_file, 'w') as f:
with open(test_file, 'wb') as f:
Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this is the intended use given that the junitxml functions explicitly return encoded strings/bytes, see:

https://github.com/ros/ros/blob/9f2051dd809352fa11bab4671f47d95129125a2e/tools/rosunit/src/rosunit/junitxml.py#L495

And the xml output elsewhere has tests which confirm that it returns bytes, eg: ros/ros#212

@mikepurvis
Copy link
Member Author

mikepurvis commented Jul 22, 2019

Ugh, the new logic only works for Python 3's minidom, as the 2.7 version doesn't supply an implementation of __contains__:

  File "/tmp/ws/src/ros_comm/tools/roslaunch/src/roslaunch/depends.py", line 99, in _check_ifunless
    if 'if' in tag.attributes:
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 522, in __getitem__
    return self._attrs[attname_or_tuple]

I don't see how to get out of making this a versioned check, possibly even as simple as hasattr(dict, 'has_key'). Will update.

@mikepurvis mikepurvis force-pushed the fix-py3-roslaunch-check branch from 474332a to 22ba27b Compare August 8, 2019 19:02
@dirk-thomas
Copy link
Member

Thanks for the fix.

@dirk-thomas dirk-thomas merged commit 14b95e2 into melodic-devel Aug 12, 2019
@dirk-thomas dirk-thomas merged commit 22ba27b into melodic-devel Aug 12, 2019
@dirk-thomas dirk-thomas deleted the fix-py3-roslaunch-check branch August 12, 2019 21:06
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