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

dot_to_qt.py: Another small fix for Python 3 compatibility #106

Merged
merged 1 commit into from
Oct 2, 2017
Merged

dot_to_qt.py: Another small fix for Python 3 compatibility #106

merged 1 commit into from
Oct 2, 2017

Conversation

kartikmohta
Copy link
Contributor

No description provided.

@dirk-thomas
Copy link
Contributor

Please provide a reproducible example.

@kartikmohta
Copy link
Contributor Author

rqt_graph crashes in Python 3 when set to show "Nodes only", unchecking the "Hide: Debug" box and pressing the refresh button. Don't need any nodes running, just roscore.

Traceback (most recent call last):
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/rqt_graph/ros_graph.py", line 231, in _refresh_rosgraph
    self._update_graph_view(self._generate_dotcode())
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/rqt_graph/ros_graph.py", line 266, in _update_graph_view
    self._redraw_graph_view()
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/rqt_graph/ros_graph.py", line 299, in _redraw_graph_view
    same_label_siblings=True)
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/qt_dotgraph/dot_to_qt.py", line 249, in dotcode_to_qt_items
    edges = self.parse_edges(graph, nodes, highlight_level, same_label_siblings)
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/qt_dotgraph/dot_to_qt.py", line 298, in parse_edges
    same_label_siblings=same_label_siblings)
  File "/opt/ros/lunar_py3/lib/python3.6/site-packages/qt_dotgraph/dot_to_qt.py", line 193, in addEdgeItem
    label = label.decode('string_escape')
AttributeError: 'str' object has no attribute 'decode'

Copy link
Contributor

@dhood dhood left a comment

Choose a reason for hiding this comment

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

The decoding was added in 18a38c8 to unescape backslash-escaped newlines in labels, which continues to work with this PR (tested manually by appending '\\nά). The type of label changes from str to unicode but I don't think there are negative side effects in python2, so LGTM.

@dhood dhood merged commit 694781b into ros-visualization:kinetic-devel Oct 2, 2017
@kartikmohta kartikmohta deleted the patch-1 branch October 2, 2017 20:51
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