8000 Add missing params to unpack() · palaviv/msgpack-python@f7d3715 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7d3715

Browse files
committed
Add missing params to unpack()
1 parent de3c2b9 commit f7d3715

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

msgpack/_unpacker.pyx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
148148

149149
def unpack(object stream, object object_hook=None, object list_hook=None,
150150
bint use_list=1, encoding=None, unicode_errors="strict",
151-
object_pairs_hook=None, ext_hook=ExtType
151+
object_pairs_hook=None, ext_hook=ExtType,
152+
Py_ssize_t max_str_len=2147483647, # 2**32-1
153+
Py_ssize_t max_bin_len=2147483647,
154+
Py_ssize_t max_array_len=2147483647,
155+
Py_ssize_t max_map_len=2147483647,
156+
Py_ssize_t max_ext_len=2147483647):
152157
):
153158
"""
154159
Unpack an object from `stream`.
@@ -159,7 +164,12 @@ def unpack(object stream, object object_hook=None, object list_hook=None,
159164
"""
160165
return unpackb(stream.read(), use_list=use_list,
161166
object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook,
162-
encoding=encoding, unicode_errors=unicode_errors, ext_hook=ext_hook
167+
encoding=encoding, unicode_errors=unicode_errors, ext_hook=ext_hook,
168+
max_str_len=max_str_len,
169+
max_bin_len=max_bin_len,
170+
max_array_len=max_array_len,
171+
max_map_len=max_map_len,
172+
max_ext_len=max_ext_len,
163173
)
164174

165175

0 commit comments

Comments
 (0)
0