8000 Fix #285 again · guoyu07/msgpack-python@fbaa136 · GitHub
[go: up one dir, main page]

Skip to content

Commit fbaa136

Browse files
committed
Fix msgpack#285 again
1 parent 3ca8eff commit fbaa136

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

msgpack/_unpacker.pyx

Lines changed: 3 additions & 18 deletions
Original 8000 file line numberDiff line numberDiff line change
@@ -211,30 +211,15 @@ def unpackb(object packed, object object_hook=None, object list_hook=None,
211211
raise UnpackValueError("Unpack failed: error = %d" % (ret,))
212212

213213

214-
def unpack(object stream, object object_hook=None, object list_hook=None,
215-
bint use_list=1, encoding=None, unicode_errors=None,
216-
object_pairs_hook=None, ext_hook=ExtType,
217-
Py_ssize_t max_str_len=2147483647, # 2**32-1
218-
Py_ssize_t max_bin_len=2147483647,
219-
Py_ssize_t max_array_len=2147483647,
220-
Py_ssize_t max_map_len=2147483647,
221-
Py_ssize_t max_ext_len=2147483647):
214+
def unpack(object stream, **kwargs):
222215
"""
223216
Unpack an object from `stream`.
224217
225218
Raises `ValueError` when `stream` has extra bytes.
226-
227219
See :class:`Unpacker` for options.
228220
"""
229-
return unpackb(stream.read(), use_list=use_list,
230-
object_hook=object_hook, object_pairs_hook=object_pairs_hook, list_hook=list_hook,
231-
encoding=encoding, unicode_errors=unicode_errors, ext_hook=ext_hook,
232-
max_str_len=max_str_len,
233-
max_bin_len=max_bin_len,
234-
max_array_len=max_array_len,
235-
max_map_len=max_map_len,
236-
max_ext_len=max_ext_len,
237-
)
221+
data = stream.read()
222+
return unpackb(data, **kwargs)
238223

239224

240225
cdef class Unpacker(object):

0 commit comments

Comments
 (0)
0