ros-visualization / rqt_graph

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

Replace str() by unicode() #17

Closed mintar closed 6 years ago

mintar commented 6 years ago

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

Traceback (most recent call last):
  File "/home/martin/ros/kinetic/rqt_graph/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)

This commit fixes that.

dirk-thomas commented 6 years ago

I would assume this patch doesn't work with Python 3?

mintar commented 6 years ago

You're right, it doesn't. I've submitted an alternative PR as #18, so feel free to close this PR if you prefer #18.

dirk-thomas commented 6 years ago

Thanks.