diff --git a/tools/rosbag/src/rosbag/bag.py b/tools/rosbag/src/rosbag/bag.py index 41c12d5eaa..533c0f60d0 100644 --- a/tools/rosbag/src/rosbag/bag.py +++ b/tools/rosbag/src/rosbag/bag.py @@ -1580,7 +1580,7 @@ def _read_uint32(f): return _unpack_uint32(f.read(4)) def _read_uint64(f): return _unpack_uint64(f.read(8)) def _read_time (f): return _unpack_time (f.read(8)) -def _unpack_str(v): return v.decode() +def _decode_str(v): return v if type(v) is str else v.decode() def _unpack_uint8(v): return struct.unpack('