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

rosunit python 3 support #190

Merged
merged 3 commits into from Aug 28, 2018

Conversation

ablakey
Copy link
Contributor

@ablakey ablakey commented Aug 20, 2018

Address #158 by explicitly decoding to utf-8 before writing to stream.

This is a typical Python 2 -> 3 issue. Before this fix, Python 2 would return a str and Python 3 would return bytes. bytes is not supported for writing to streams like stdout in Python 3.

This fix explicitly decodes to utf-8 before writing, so in Python 2 we're writing a unicode object and in Python 3 we're writing a str object.

Address ros#158 by explicitly decoding to utf-8 before writing to stream.
@dirk-thomas
Copy link
Member

Please avoid any unrelated whitespace changes.

@ablakey
Copy link
Contributor Author

ablakey commented Aug 28, 2018

Sorry. My text editor fixes those mistakes automatically. Reverted.

@dirk-thomas
Copy link
Member

Sorry. My text editor fixes those mistakes automatically. Reverted.

I know it is annoying 😞 Once we get close to Indigo being EOLed we hopefully have only a single branch to maintain and can cleanup a lot of the code (without having to worry about backporting patches).

Thanks for the patch.

@dirk-thomas dirk-thomas merged commit fd86014 into ros:kinetic-devel Aug 28, 2018
@paulbovbel
Copy link
Contributor

Can I request a tagged release that includes this patch please?

@dirk-thomas
Copy link
Member

It will likely be January until I get to do ROS 1 patch releases.

nim65s added a commit to nim65s/robotpkg that referenced this pull request May 30, 2020
to fix in rosunit / Python 3:
  File "$ROBOTPKG_BASE/lib/python3.8/site-packages/rosunit/xmlrunner.py", line 202, in print_report
    stream.write(ET.tostring(self.xml(time_taken, out, err).getroot(), encoding='utf-8', method='xml'))
TypeError: write() argument must be str, not bytes

ref ros/ros#190
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.

None yet

3 participants