Cbor2

Latest version: v5.6.5

Safety actively analyzes 714736 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 6

4.1.1

Not secure
- Fixed encoding of negative ``decimal.Decimal`` instances (PR by Sekenre)

4.1.0

Not secure
- Added canonical encoding (via ``canonical=True``) (PR by Sekenre)
- Added support for encoding/decoding sets (semantic tag 258) (PR by Sekenre)
- Added support for encoding ``FrozenDict`` (hashable dict) as map keys or set elements (PR by
Sekenre)

4.0.1

Not secure
- Fixed silent truncation of decoded data if there are not enough bytes in the stream for an exact
read (``CBORDecodeError`` is now raised instead)

4.0.0

Not secure
- **BACKWARD INCOMPATIBLE** Value sharing has been disabled by default, for better compatibility
with other implementations and better performance (since it is rarely needed)
- **BACKWARD INCOMPATIBLE** Replaced the ``semantic_decoders`` decoder option with the
``CBORDecoder.tag_hook`` option
- **BACKWARD INCOMPATIBLE** Replaced the ``encoders`` encoder option with the
``CBOREncoder.default`` option
- **BACKWARD INCOMPATIBLE** Factored out the file object argument (``fp``) from all callbacks
- **BACKWARD INCOMPATIBLE** The encoder no longer supports every imaginable type implementing the
``Sequence`` or ``Map`` interface, as they turned out to be too broad
- Added the ``CBORDecoder.object_hook`` option for decoding dicts into complex objects (intended
for situations where JSON compatibility is required and semantic tags cannot be used)
- Added encoding and decoding of simple values (``CBORSimpleValue``) (contributed by Jerry
Lundström)
- Replaced the decoder for bignums with a simpler and faster version (contributed by orent)
- Made all relevant classes and functions available directly in the ``cbor2`` namespace
- Added proper documentation

3.0.4

Not secure
- Fixed TypeError when trying to encode extension types (regression introduced in 3.0.3)

3.0.3

Not secure
- No changes, just re-releasing due to git tagging screw-up

Page 5 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.