zopefoundation / DateTime

This package provides a DateTime data type, as known from Zope. Unless you need to communicate with Zope APIs, you're probably better off using Python's built-in datetime module.
Other
19 stars 25 forks source link

Change pickle format to export the micros as int #62

Closed perrinjerome closed 7 months ago

perrinjerome commented 7 months ago

During pickle serialization, the _micros attribute was casted to float, to save a little bit of disk space by making shorter pickles, this was true when ZODB was using pickle protocol 1, but nowadays it uses protocol 3 and exporting as an int produces pickles of the same length as with a float.

Fixes #56

perrinjerome commented 7 months ago

( I used perrinjerome/fix-year-2038 as branch name, but it's in https://github.com/zopefoundation/DateTime/ repository )

d-maurer commented 7 months ago

Jérome Perrin wrote at 2024-3-20 22:32 -0700:

... it's like this in other places in this file, I was tempted to remove this

https://github.com/zopefoundation/DateTime/blob/0a59b4d620fee02389543160e1f77f75c10b9292/src/DateTime/DateTime.py#L36-L38C1

I have seen this only after my suggestion (checking why the tests did not fail).

and replace int everywhere, we can do that in another PR

+1

icemac commented 7 months ago

Released in https://pypi.org/project/DateTime/5.5/