Skip to content

Commit

Permalink
Fix typeError (#7)
Browse files Browse the repository at this point in the history
In python 3, message.serialize expects a buffer that will accept a
bytes-type input to it's write function. This commit uses the same
fix as ros_comm PR #847[1].

[1] ros/ros_comm#847
  • Loading branch information
CBJamo authored and dirk-thomas committed Jan 9, 2020
1 parent 2b839f9 commit 33a2ef4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rqt_topic/topic_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@

from __future__ import division, with_statement
try:
from cStringIO import StringIO
from cStringIO import StringIO as BufferType
except ImportError:
from io import StringIO
from io import BytesIO as BufferType

from python_qt_binding.QtCore import qWarning

Expand Down Expand Up @@ -96,7 +96,7 @@ def message_callback(self, message):
# FIXME: this only works for message of class AnyMsg
# self.sizes.append(len(message._buff))
# time consuming workaround...
buff = StringIO()
buff = BufferType()
message.serialize(buff)
self.sizes.append(len(buff.getvalue()))

Expand Down

0 comments on commit 33a2ef4

Please sign in to comment.