From a46647a87a1d992f1ec759fa632a4247d2999a59 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 23 Jan 2016 20:17:25 -0800 Subject: [PATCH] python3: Mark certain strings as unicode strings. This is required in Python 3 since these strings are combined with other unicode strings. --- zerver/lib/actions.py | 2 +- zerver/worker/queue_processors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 373c2562d0..1e4d663950 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -88,7 +88,7 @@ def log_event(event): with lockfile(template % ('lock',)): with open(template % ('events',), 'a') as log: - log.write(ujson.dumps(event) + '\n') + log.write(ujson.dumps(event) + u'\n') def active_user_ids(realm): return [userdict['id'] for userdict in get_active_user_dicts_in_realm(realm)] diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index fb635c1774..0a24459313 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -75,7 +75,7 @@ class QueueProcessingWorker(object): os.mkdir(settings.QUEUE_ERROR_DIR) fname = '%s.errors' % (self.queue_name,) fn = os.path.join(settings.QUEUE_ERROR_DIR, fname) - line = '%s\t%s\n' % (time.asctime(), ujson.dumps(data)) + line = u'%s\t%s\n' % (time.asctime(), ujson.dumps(data)) lock_fn = fn + '.lock' with lockfile(lock_fn): with open(fn, 'a') as f: