From dded47e33273f32b441fe2539307173055048252 Mon Sep 17 00:00:00 2001 From: manreo <35897350+manreo@users.noreply.github.com> Date: Tue, 4 Jan 2022 10:43:25 -0500 Subject: [PATCH] LightningRpc should accept pathlib Path Not sure why socket does not accept pathlib, but just added some code to transform the path to string. It is not the most pretty code, but better than these: https://stackoverflow.com/questions/58647584/how-to-test-if-object-is-a-pathlib-path --- contrib/pyln-client/pyln/client/lightning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pyln-client/pyln/client/lightning.py b/contrib/pyln-client/pyln/client/lightning.py index 9d37fb86e..b0829e852 100644 --- a/contrib/pyln-client/pyln/client/lightning.py +++ b/contrib/pyln-client/pyln/client/lightning.py @@ -223,7 +223,7 @@ class UnixSocket(object): """ def __init__(self, path: str): - self.path = path + self.path = str(path) if 'pathlib' in str(type(path)) else path self.sock: Optional[socket.SocketType] = None self.connect()