diff --git a/src/wormhole/journal.py b/src/wormhole/journal.py index 7d640ea..61d1694 100644 --- a/src/wormhole/journal.py +++ b/src/wormhole/journal.py @@ -1,6 +1,7 @@ +from __future__ import print_function, absolute_import, unicode_literals from zope.interface import implementer import contextlib -from _interfaces import IJournal +from ._interfaces import IJournal @implementer(IJournal) class Journal(object): diff --git a/src/wormhole/test/test_machines.py b/src/wormhole/test/test_machines.py index c7b0332..998ab47 100644 --- a/src/wormhole/test/test_machines.py +++ b/src/wormhole/test/test_machines.py @@ -228,7 +228,7 @@ class Key(unittest.TestCase): k.got_code(code) self.assertEqual(len(events), 1) self.assertEqual(events[0][:2], ("m.add_message", "pake")) - msg1_json = events[0][2] + msg1_json = events[0][2].decode("utf-8") events[:] = [] msg1 = json.loads(msg1_json) msg1_bytes = hexstr_to_bytes(msg1["pake_v1"]) @@ -249,9 +249,9 @@ class Key(unittest.TestCase): k.got_code(code) self.assertEqual(len(events), 1) self.assertEqual(events[0][:2], ("m.add_message", "pake")) - pake_1_json = events[0][2] + pake_1_json = events[0][2].decode("utf-8") pake_1 = json.loads(pake_1_json) - self.assertEqual(pake_1.keys(), ["pake_v1"]) # value is PAKE stuff + self.assertEqual(list(pake_1.keys()), ["pake_v1"]) # value is PAKE stuff events[:] = [] bad_pake_d = {"not_pake_v1": "stuff"} k.got_pake(dict_to_bytes(bad_pake_d)) diff --git a/src/wormhole/test/test_scripts.py b/src/wormhole/test/test_scripts.py index 142bd95..55b4ae4 100644 --- a/src/wormhole/test/test_scripts.py +++ b/src/wormhole/test/test_scripts.py @@ -175,11 +175,11 @@ class ScriptsBase: # Setting LANG/LC_ALL to a unicode-capable locale is necessary to # convince Click to not complain about a forced-ascii locale. My # apologies to folks who want to run tests on a machine that doesn't - # have the en_US.UTF-8 locale installed. + # have the C.UTF-8 locale installed. wormhole = self.find_executable() d = getProcessOutputAndValue(wormhole, ["--version"], - env=dict(LC_ALL="en_US.UTF-8", - LANG="en_US.UTF-8")) + env=dict(LC_ALL="C.UTF-8", + LANG="C.UTF-8")) def _check(res): out, err, rc = res if rc != 0: @@ -335,7 +335,7 @@ class PregeneratedCode(ServerBase, ScriptsBase, unittest.TestCase): send_d = getProcessOutputAndValue( wormhole_bin, send_args, path=send_dir, - env=dict(LC_ALL="en_US.UTF-8", LANG="en_US.UTF-8"), + env=dict(LC_ALL="C.UTF-8", LANG="C.UTF-8"), ) recv_args = [ '--relay-url', self.relayurl, @@ -351,7 +351,7 @@ class PregeneratedCode(ServerBase, ScriptsBase, unittest.TestCase): receive_d = getProcessOutputAndValue( wormhole_bin, recv_args, path=receive_dir, - env=dict(LC_ALL="en_US.UTF-8", LANG="en_US.UTF-8"), + env=dict(LC_ALL="C.UTF-8", LANG="C.UTF-8"), ) (send_res, receive_res) = yield gatherResults([send_d, receive_d],