From 4bd64885b40436f103ad1fcaa5caf87e92debb01 Mon Sep 17 00:00:00 2001 From: Michael Himing Date: Mon, 21 Feb 2022 09:15:49 +1100 Subject: [PATCH] msgpack.unpack requires a readable stream --- shared-module/msgpack/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index 7a6892c51f..e1b98a9f93 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -497,6 +497,6 @@ void common_hal_msgpack_pack(mp_obj_t obj, mp_obj_t stream_obj, mp_obj_t default } mp_obj_t common_hal_msgpack_unpack(mp_obj_t stream_obj, mp_obj_t ext_hook, bool use_list) { - msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_WRITE); + msgpack_stream_t stream = get_stream(stream_obj, MP_STREAM_OP_READ); return unpack(&stream, ext_hook, use_list); }