Xilinx-CNS / solarcapture

SolarCapture network packet capture suite
Other
13 stars 8 forks source link

solar_capture_monitor 'type' output has an extraneous b' #8

Open abrunnin-xilinx opened 5 months ago

abrunnin-xilinx commented 5 months ago

This is an outstanding minor bug from the python3 conversion. When outputting the type of the nodes, it stringifies it to b'name'instead of just plain name Which means it's got a 'bytes' rather than a string.

image

There's possibly other output where this should be corrected as well, I didn't exhaustively check yet, just noticed this one.

I think this output comes from action_nodes in solar_capture_monitor - but it wold probably be better to correct it in stringify_table (in tabulate.py) - which currently just does str(f) on the field it's going to print, but could be improved to something different based in data type.

abrunnin-xilinx commented 5 months ago

(was a duplicate comment because I was trying to edit the description)

abrunnin-xilinx commented 5 months ago

Something like:

def stringify(field):
  try:
     return field.decode('utf-8')
   except:
     return str(field)