Skip to content

Commit 6f9e8a7

Browse files
committed
Fix a year 2038 issue
This bug was found while working on reproducible builds for openSUSE.
1 parent 7a9174c commit 6f9e8a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bson/objectid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def __generate(self):
184184
"""
185185

186186
# 4 bytes current time
187-
oid = struct.pack(">i", int(time.time()))
187+
oid = struct.pack(">i", int(time.time()) & 0xffffffff)
188188

189189
# 3 bytes machine
190190
oid += ObjectId._machine_bytes

0 commit comments

Comments
 (0)