ros-visualization / rqt_bag

http://wiki.ros.org/rqt_bag
31 stars 55 forks source link

Cannot open bag file if path contains unicode characters #24

Closed VictorLamoine closed 6 years ago

VictorLamoine commented 6 years ago

I tried to open a bag file /home/victor/Téléchargements/data_2018-02-28-12-10-50.bag

$ rqt_bag
Traceback (most recent call last):
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_bag/bag_widget.py", line 264, in _handle_load_clicked
    self.load_bag(filename[0])
  File "/opt/ros/kinetic/lib/python2.7/dist-packages/rqt_bag/bag_widget.py", line 267, in load_bag
    qDebug("Loading '%s'..." % filename)
TypeError: qDebug(str): argument 1 has unexpected type 'unicode'

The é in the path name causes the problem. Tested on ROS Kinetic


Commenting the two qDebug lines in the code makes the import work.


http://doc.qt.io/qt-5/qtextcodec.html#fromUnicode

Seems like it would solve the problem.