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

gnuradio encountered errors when trying to display non utf8 string #7282

Open
cxp10 opened this issue Apr 20, 2024 · 0 comments
Open

gnuradio encountered errors when trying to display non utf8 string #7282

cxp10 opened this issue Apr 20, 2024 · 0 comments

Comments

@cxp10
Copy link

cxp10 commented Apr 20, 2024

What happened?

If the Message PMT parameter of Message Strobe block is set to pmt.intern(b'\xff'), some UnicodeEncodeError will only appear in the background terminal window. This should be a bug.
After that, gnuradio probably still works, although the preview of b'\xff' disappears.
At worst, if the message strobe is the last block to be added to the flow graph, gnuradio will crash when the flow graph is loaded.

possible cause
#3778 flawed __str()__ method
similar issue
#3398 same issue for u8vector
#7143 possibly because print() called __str()__

System Information

OS: Ubuntu 22
GR Installation Method: Source

GNU Radio Version

3.10 (maint-3.10)

Specific Version

v3.10.9.2-60-gb0766390

Steps to Reproduce the Problem

Create a new grc flow graph,
add a message strobe block,
change the message pmt to pmt.intern(b'\xff'),
Then there will be UnicodeEncodeError in the terminal window.
Save the grc file,
reopen the grc file,
Then gnuradio would crash.

Relevant log output

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/PropsDialog.py", line 320, in _handle_response
    child.apply_pending_changes()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 166, in apply_pending_changes
    self._apply_change()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 156, in _apply_change
    self._update_gui()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/ParamWidgets.py", line 126, in _update_gui
    self.set_tooltip_text(self.param.format_tooltip_text())
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/canvas/param.py", line 78, in format_tooltip_text
    value = str(value)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/Application.py", line 570, in _handle_action
    flow_graph_update()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/Application.py", line 112, in flow_graph_update
    fg.update()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/canvas/flowgraph.py", line 202, in update
    self.create_labels()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/canvas/flowgraph.py", line 510, in create_labels
    element.create_labels(cr)
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/canvas/block.py", line 182, in create_labels
    markups = [param.format_block_surface_markup()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/canvas/block.py", line 182, in <listcomp>
    markups = [param.format_block_surface_markup()
  File "/usr/local/lib/python3.10/dist-packages/gnuradio/grc/gui/canvas/param.py", line 167, in format_block_surface_markup
    is_evaluated = self.value != str(self.get_evaluated())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
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

No branches or pull requests

1 participant