File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
contrib/pyln-client/pyln/client Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 33import os
44import socket
55import sys
6+ import tempfile
67from contextlib import contextmanager
78from decimal import Decimal
89from json import JSONEncoder
@@ -256,6 +257,14 @@ def connect(self) -> None:
256257 short_path = "/proc/self/fd/%d/%s" % (dirfd , basename )
257258 self .sock = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
258259 self .sock .connect (short_path )
260+ elif (e .args [0 ] == "AF_UNIX path too long" and os .uname ()[0 ] == "Darwin" ):
261+ temp_dir = tempfile .mkdtemp ()
262+ temp_link = os .path .join (temp_dir , "socket_link" )
263+ if os .path .exists (temp_link ):
264+ os .unlink (temp_link )
265+ os .symlink (self .path , temp_link )
266+ self .sock = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
267+ self .sock .connect (temp_link )
259268 else :
260269 # There is no good way to recover from this.
261270 raise
You can’t perform that action at this time.
0 commit comments