Closed appleby closed 4 years ago
The upshot of this is that you can rpcq:rpc-call
a nullary rpc method from a lisp client to a python server, whereas before this would result in an exception being raised on the python side.
I think it would also work to omit the *args
key from hash-table entirely if there are no required args, but haven't tested it. I went with coercing NIL
to #()
since it seemed like a smaller change.
Won't merge until there's at least one other review.
So you're saying lisp is better than python?
A P P R O V E D
Coerce positional args to a
VECTOR
inPREPARE-RPC-CALL-ARGS
to ensure they are encoded as an array. This makes no difference when positional args exist since both non-emptyLIST
s andARRAY
s get encoded to messagepack array formats; if args isNIL
, however,CL-MESSAGEPACK
encodesNIL
to a messagepack NIL format0xc0
, which gets decoded asNone
on the Python side. This results in anException
being raised inRPCSpec.run_handler
when attempting to decode the args since it expects*args
to be anIterable
, notNone
.The RPCQ lisp server was unaffected by this since messagepack NIL is decode to lisp
NIL
, and the lisp server only calls genericSEQUENCE
processing functions (CONCATENATE
) on the deserialized value, and hence doesn't distinguish between an emptyLIST
orARRAY
.