-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
if isinstance(value, (int, long)):
- TODO this is a really ugly way to check for this...
if value > 2 ** 64 / 2 - 1 or value < -2 ** 64 / 2:
raise OverflowError("BSON can only handle up to 8-byte ints")
if value > 2 ** 32 / 2 - 1 or value < -2 ** 32 / 2:
return "\x12" + name + struct.pack("<q", value)
return "\x10" + name + struct.pack("<i", value)
This is a really ugly way and it does not allow to store long (>2**32) value, which was stored as zero and then $inc'ed.
- related to
-
PYTHON-923 Add 3.0 changelog entry about bson.int64.Int64
- Closed