Skip to content

Commit 392d56a

Browse files
correct computation of number of bits for unbounded integers in blobs
1 parent f1e6da6 commit 392d56a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

datajoint/blob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def read_int(self):
268268

269269
@staticmethod
270270
def pack_int(v):
271-
return b"\x0a" + v.to_bytes((v.bit_length() + 7 + (v < 0)) // 8, byteorder='little', signed=True)
271+
return b"\x0a" + v.to_bytes(v.bit_length() // 8 + 1, byteorder='little', signed=True)
272272

273273
def read_bool(self):
274274
return bool(self.read_value('bool'))

0 commit comments

Comments
 (0)