From 0295468a3e9617c2424013814ce922357b89cb97 Mon Sep 17 00:00:00 2001 From: Jarret Dyrbye Date: Mon, 2 Sep 2019 15:29:56 -0600 Subject: [PATCH] pylightning - allow unicode symbols in the description to be passed as-is to the daemon addresses issue #2753. Formatting the JSON with the default parameters will escape the unicode symbols in a way that c-lightning won't allow, leading to an exception. Changelog-Fixed: `pylightning` now handles unicode characters in JSON-RPC requests and responses correctly. --- contrib/pylightning/lightning/lightning.py | 2 +- tests/test_misc.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/pylightning/lightning/lightning.py b/contrib/pylightning/lightning/lightning.py index 434fbc0234f3..5e1cfff92746 100644 --- a/contrib/pylightning/lightning/lightning.py +++ b/contrib/pylightning/lightning/lightning.py @@ -172,7 +172,7 @@ def __init__(self, socket_path, executor=None, logger=logging, encoder_cls=json. self.next_id = 0 def _writeobj(self, sock, obj): - s = json.dumps(obj, cls=self.encoder_cls) + s = json.dumps(obj, ensure_ascii=False, cls=self.encoder_cls) sock.sendall(bytearray(s, 'UTF-8')) def _readobj(self, sock, buff=b''): diff --git a/tests/test_misc.py b/tests/test_misc.py index e80ef84fb530..7faa8c3c993d 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1700,7 +1700,6 @@ def test_signmessage(node_factory): assert checknokey['verified'] -@pytest.mark.xfail(strict=True) def test_unicode_rpc(node_factory): node = node_factory.get_node() desc = "Some candy 🍬 and a nice glass of milk 🥛."