Skip to content

Commit

Permalink
Fix a year 2038 issue
Browse files Browse the repository at this point in the history
This bug was found while working on reproducible builds for openSUSE.
  • Loading branch information
bmwiedemann committed Aug 29, 2022
1 parent 7a9174c commit 6f9e8a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bson/objectid.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __generate(self):
"""

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

# 3 bytes machine
oid += ObjectId._machine_bytes
Expand Down

0 comments on commit 6f9e8a7

Please sign in to comment.