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

TypeError: string pattern on a bytes-like object #193

Closed
wants to merge 1 commit into from

Conversation

kindofausername
Copy link

Wanted to use

$ rosrun tf view_frames

Listening to /tf for 5.0 seconds
Done Listening
b'dot - graphviz version 2.40.1 (20161225.0304)\n'
Traceback (most recent call last):
File "/opt/ros/melodic/lib/tf/view_frames", line 119, in
generate(dot_graph)
File "/opt/ros/melodic/lib/tf/view_frames", line 89, in generate
m = r.search(vstr)
TypeError: cannot use a string pattern on a bytes-like object

Simply adding the .decode('utf-8') to m = r.search(vstr.decode('utf-8')) fixed it.

Wanted to use

$ rosrun tf view_frames

Listening to /tf for 5.0 seconds
Done Listening
b'dot - graphviz version 2.40.1 (20161225.0304)\n'
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/tf/view_frames", line 119, in <module>
    generate(dot_graph)
  File "/opt/ros/melodic/lib/tf/view_frames", line 89, in generate
    m = r.search(vstr)
TypeError: cannot use a string pattern on a bytes-like object

Simply adding the .decode('utf-8') to m = r.search(vstr.decode('utf-8')) fixed it.
@andersdu
Copy link

saved my day!

@ymollard
Copy link

ymollard commented Nov 20, 2020

You may prefer tf2 since tf is now deprecated: rosrun tf2_tools view_frames.py which requires sudo apt install ros-noetic-tf2-tools first.

But anyway, tf is still there, could anyone merge this, please? Maybe @tfoote?
Maybe rebased into noetic-devel though, since only Noetic is running with py3 by default.

@acarrillo
Copy link

You may prefer tf2 since tf is now deprecated: roslaunch tf2_tools view_frames.py which requires sudo apt install ros-noetic-tf2-tools first.

Very minor: that suggestion should be rosrun instead of roslaunch, like rosrun tf2_tools view_frames.py.

And +1 for targeting noetic, much agreed!

@MichaelGrupp
Copy link
Contributor

I opened a similar PR - this whole code block is useless nowadays, so the problem can be also resolved by removing the check: #222

@lucbettaieb
Copy link

@tfoote +1 <3

@lucbettaieb
Copy link

+1 @mikeferguson maybe?

@tfoote
Copy link
Member

tfoote commented Sep 10, 2021

Replaced by #222

@tfoote tfoote closed this Sep 10, 2021
@Esmaeel-Hilal
Copy link

Thank you, you saved me

@Nassef10
Copy link

Nassef10 commented Mar 7, 2023

how can i edit this file ? it refuses to be edited, it is secured !

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.

9 participants