Prevent construction of unicode Message.data

And fix one case of it in parent.py.
This commit is contained in:
David Wilson 2018-04-17 13:38:30 +01:00
parent 41d2661ecb
commit 202ce0f641
2 changed files with 2 additions and 1 deletions

View File

@ -314,6 +314,7 @@ class Message(object):
self.src_id = mitogen.context_id
self.auth_id = mitogen.context_id
vars(self).update(kwargs)
assert isinstance(self.data, str)
def _unpickle_context(self, context_id, name):
return _unpickle_context(self.router, context_id, name)

View File

@ -675,7 +675,7 @@ class RouteMonitor(object):
data = str(target_id)
if name:
data = '%s:%s' % (target_id, name)
data = '%s:%s' % (target_id, mitogen.core.b(name))
self.parent.send(
mitogen.core.Message(
handle=handle,