8000 Synchronize handling of datetime in Packer implementations (#434) · vladima/msgpack-python@772c830 · GitHub
[go: up one dir, main page]

Skip to content

Commit 772c830

Browse files
authored
Synchronize handling of datetime in Packer implementations (msgpack#434)
The handling of datetime is different in the cython and Python implementations. In contrast to the docs, timezone is not required in the Python implementation.
1 parent 5614dd5 commit 772c830

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

msgpack/fallback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ def _pack(
921921
len(obj), dict_iteritems(obj), nest_limit - 1
922922
)
923923

924-
if self._datetime and check(obj, _DateTime):
924+
if self._datetime and check(obj, _DateTime) and obj.tzinfo is not None:
925925
obj = Timestamp.from_datetime(obj)
926926
default_used = 1
927927
continue

0 commit comments

Comments
 (0)
0