Upgrading msgpack 0.5 to 0.6
Breaking0.5.6 → 0.6.2Breaking3Platform1Deprecated1New4Changed5
BreakingUpgrade verdict
3 breaking changes and a platform requirement change.
In plain terms
- The unpacker now refuses very large inputs by default to protect against denial-of-service attacks. If you legitimately handle big payloads, you must raise the limits yourself.
- Errors raised while unpacking now come through as their original exception types instead of being converted to UnpackValueError, so catch code may need updating.
- Two custom packing exception classes no longer exist, so error handling should use the standard Python exceptions.
- The package now works with Python 3.8.
Must act 5 items need code or config changes
What you must change
Breaking3
Default input limits for unpacker are smaller to avoid DoS attacks; large data requires specifying limits manually.
UnpackerUnpacker no longer wraps underlying ValueError (including UnicodeError) into UnpackValueError.
UnpackerUnpackValueErrorValueErrorUnicodeErrorPackValueError and PackOverflowError are removed; catch normal ValueError and OverflowError instead.
PackValueErrorPackOverflowErrorValueErrorOverflowErrorPlatform1
Adds support for Python 3.8.
Deprecations to plan for
Deprecated1
Deprecates max_bin_len, max_str_len, and max_ext_len; documentation-only deprecation in this minor release.
max_bin_lenmax_str_lenmax_ext_lenAPI changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- removed:
class PackException(Exception) - removed:
class PackOverflowError(PackValueError, OverflowError) - removed:
class PackValueError(PackException, ValueError) - removed:
class UnpackValueError(UnpackException, ValueError) - added:
class FormatError(ValueError, UnpackException) - added:
class StackError(ValueError, UnpackException) - added:
variable PackException - added:
variable PackOverflowError - added:
variable PackValueError - added:
variable UnpackValueError
- removed:
variable PY3 - removed:
variable Unicode - changed:
constructor Unpacker(file_like=…, read_size=…, use_list=…, raw=…, object_hook=…, object_pairs_hook=…, list_hook=…, encoding=…, unicode_errors=…, max_buffer_size=…, ext_hook=…, max_str_len=…, max_bin_len=…, max_array_len=…, max_map_len=…, max_ext_len=…) → constructor Unpacker(file_like=…, read_size=…, use_list=…, raw=…, strict_map_key=…, object_hook=…, object_pairs_hook=…, list_hook=…, encoding=…, unicode_errors=…, max_buffer_size=…, ext_hook=…, max_str_len=…, max_bin_len=…, max_array_len=…, max_map_len=…, max_ext_len=…) - changed:
method Unpacker.read_array_header(write_bytes=…) → method Unpacker.read_array_header() - changed:
method Unpacker.read_map_header(write_bytes=…) → method Unpacker.read_map_header() - changed:
method Unpacker.skip(write_bytes=…) → method Unpacker.skip() - changed:
method Unpacker.unpack(write_bytes=…) → method Unpacker.unpack() - added:
method Packer.getbuffer() - added:
variable PY2 - added:
variable RecursionError - added:
variable unicode