summaryrefslogtreecommitdiff
path: root/distbuild/jm.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-07-15 12:23:49 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-07-15 12:23:49 +0000
commite8adedb8f3f27d9212caf277b8e8f7c6792a20c2 (patch)
treef8460c9ff73cea780d944f18d1bab49f2653b1cf /distbuild/jm.py
parent3f686a074fdb66e75e67e276d21bdc604b34920c (diff)
parent40a5c752de62dd1b3ef3ec0850f1f24e7af67052 (diff)
downloadmorph-e8adedb8f3f27d9212caf277b8e8f7c6792a20c2.tar.gz
Fix JSON file handling to be binary filename safe
Reviewed-by: Lars Wirzenius Reviewed-by: Pedro Alvarez
Diffstat (limited to 'distbuild/jm.py')
-rw-r--r--distbuild/jm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/distbuild/jm.py b/distbuild/jm.py
index 69fa5bd1..97ee1a0f 100644
--- a/distbuild/jm.py
+++ b/distbuild/jm.py
@@ -67,7 +67,7 @@ class JsonMachine(StateMachine):
def send(self, msg):
'''Send a message to the other side.'''
- self.sockbuf.write('%s\n' % json.dumps(msg))
+ self.sockbuf.write('%s\n' % json.dumps(msg, encoding='unicode-escape'))
def close(self):
'''Tell state machine it should shut down.
@@ -91,7 +91,7 @@ class JsonMachine(StateMachine):
line = line.rstrip()
if self.debug_json:
logging.debug('JsonMachine: line: %s' % repr(line))
- msg = json.loads(line)
+ msg = json.loads(line, encoding='unicode-escape')
self.mainloop.queue_event(self, JsonNewMessage(msg))
def _send_eof(self, event_source, event):