Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

roslaunch: Fix <param command="..." /> for python3.#840

Merged
dirk-thomas merged 1 commit intoros:kinetic-develfrom
fizyr-private:roslaunch-param-command-python3
Jul 22, 2016
Merged

roslaunch: Fix <param command="..." /> for python3.#840
dirk-thomas merged 1 commit intoros:kinetic-develfrom
fizyr-private:roslaunch-param-command-python3

Conversation

@de-vri-es
Copy link
Copy Markdown
Contributor

In python3, the standard output of the subprocess is of type bytes. That causes the data to be stored as a binary xmlrpc node which ends up base64 encoded when retrieving it later. Additionally, it crashed the rosparam command line utility which could not deal with that.

This PR checks if the read command output is not of type str and decodes it as UTF-8 in that case. This is a NOP in python2. We can't check if the read output is of type bytes, because in python2 bytes is just an alias for str.

In python3, the standard output of the subprocess is of type bytes. That
causes the data to be stored as a binary xmlrpc node which ends up
base64 encoded when retrieving it later. Additionally, it crashed the
rosparam command line utility which could not deal with that.

This commit checks if the read command output is not of type `str` and
decodes it as UTF-8 in that case. This is a NOP in python2. We can't
check if the read output is of type bytes, because in python2 `bytes`
is just an alias for `str`.
@dirk-thomas
Copy link
Copy Markdown
Member

Thank you for the patch.

@dirk-thomas dirk-thomas merged commit 54398ba into ros:kinetic-devel Jul 22, 2016
@de-vri-es
Copy link
Copy Markdown
Contributor Author

Thanks for the merge :)

rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this pull request Jun 19, 2017
…-python3

roslaunch: Fix <param command="..." /> for python3.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants