From 26b4a116ba42f45c042e2d21b9db6d91153569b7 Mon Sep 17 00:00:00 2001 From: inportb Date: Sat, 1 Oct 2022 00:24:38 -0400 Subject: [PATCH] 1-based indexing for RPC list parameters --- rpc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc.py b/rpc.py index 8ff9ca7..6985f0b 100644 --- a/rpc.py +++ b/rpc.py @@ -32,7 +32,7 @@ def l_pack(value: Any, envelope: int=3, wrapped: bool=True, basictype=b'0', enco bare = b't'.join(l_pack(k, envelope=envelope, wrapped=False, encoding=encoding) + l_pack(v, envelope=envelope, wrapped=False, encoding=encoding) for k, v in value.items()) return (b'2' + bare + b'f') if wrapped else bare elif not isinstance(value, str) and hasattr(value, '__iter__'): - bare = b't'.join(l_pack(k, envelope=envelope, wrapped=False, encoding=encoding) + l_pack(v, envelope=envelope, wrapped=False, encoding=encoding) for k, v in enumerate(value)) + bare = b't'.join(l_pack(k, envelope=envelope, wrapped=False, encoding=encoding) + l_pack(v, envelope=envelope, wrapped=False, encoding=encoding) for k, v in enumerate(value, start=1)) return (b'2' + bare + b'f') if wrapped else bare elif isinstance(value, MReference): return l_pack(str(value), envelope=envelope, basictype=b'1', encoding=encoding)