> + return b"#%s %s %d:%s %s" % ((b'%d' % self.origpos).ljust(2), > + action.ljust(6), r, h, desc) > + > + __bytes__ = __str__ `__str__ = encoding.strmethod(__bytes__)` can be used instead. `__str__` of Python3 must return unicode string.