msgpack-python/msgpack
Kadir Can Ozden 4ea42eba4d Fix Timestamp.from_datetime returning wrong value for pre-epoch times
int() truncates towards zero, so for pre-epoch datetimes with non-zero
microseconds the seconds component gets the wrong value. For example,
datetime(1969, 12, 31, 23, 59, 59, 500000, UTC) has timestamp -0.5,
but int(-0.5) == 0, producing Timestamp(0, 500000000) (+0.5s after
epoch) instead of Timestamp(-1, 500000000) (-0.5s before epoch).

Use floor division (// 1) instead, consistent with from_unix().
2026-02-20 14:59:16 +03:00
..
__init__.py release v1.1.2 (#649) 2025-10-08 17:56:20 +09:00
_cmsgpack.pyx cython: freethreading_compatible (#654) 2025-10-09 15:53:08 +09:00
_packer.pyx cython: freethreading_compatible (#654) 2025-10-09 15:53:08 +09:00
_unpacker.pyx cython: freethreading_compatible (#654) 2025-10-09 15:53:08 +09:00
exceptions.py Add StackError and FormatError (#331) 2018-11-20 13:12:49 +09:00
ext.py Fix Timestamp.from_datetime returning wrong value for pre-epoch times 2026-02-20 14:59:16 +03:00
fallback.py Cleanup code and pyproject (#608) 2024-05-06 11:46:31 +09:00
pack.h cython: better exception handling (#606) 2024-05-06 02:13:12 +09:00
pack_template.h Remove unused code (#603) 2024-05-06 00:13:59 +09:00
sysdep.h Fix build error caused by ntohs, ntohl (#514) 2022-08-08 15:08:40 +09:00
unpack.h use PyLong_* instead of PyInt_* (#620) 2024-08-21 14:56:00 +09:00
unpack_container_header.h Stop using c++ (#600) 2024-05-04 16:01:48 +09:00
unpack_define.h Support unpacking new types. 2013-10-20 22:59:27 +09:00
unpack_template.h Stop using c++ (#600) 2024-05-04 16:01:48 +09:00