Prevent construction of unicode Message.data
And fix one case of it in parent.py.
This commit is contained in:
parent
41d2661ecb
commit
202ce0f641
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue