ros-visualization / rqt_graph

http://wiki.ros.org/rqt_graph
26 stars 27 forks source link

Use unicode version of str() #18

Closed mintar closed 6 years ago

mintar commented 6 years ago

This commit fixes the following bug: If the user entered a non-ASCII character into one of the filter text boxes (for example, by hitting the 'ü' key on a German keyboard by accident), the application crashed before with the following error:

Traceback (most recent call last):
  File "~/catkin_ws/src/rqt_graph/src/rqt_graph/ros_graph.py", line 69, in splitPath
    path = str(path.split(',')[-1]).lstrip(' ')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 16: ordinal not in range(128)

The python3 str() function does the same as the python2 unicode() function. By importing str() from builtins, the code is compatible with both python2 and python3.

mintar commented 6 years ago

@ros-pull-request-builder retest this please

mintar commented 6 years ago

Test failure on indigo seems unrelated.

dirk-thomas commented 6 years ago

Closing in favor of #17.