| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
integers. (GH-3947) (#4086)
Bad remainder in divmod() in intermediate calculations caused an assertion failure.
(cherry picked from commit 4ffd4653a7ec9c97775472276cf5e159e2366bb2)
|
| |
|
|
|
| |
with a bad as_integer_ratio() method. (GH-3227) (#3654)
(cherry picked from commit 865e4b4f630e2ae91e61239258abb58b488f1d65)
|
| |
|
|
|
| |
objects when pass out of bound fold argument.
(cherry picked from commit 314d6fca36a4eaa0541218431d14804fadec6488)
|
| |
|
|
|
| |
Issue #29100: Fix datetime.fromtimestamp() regression introduced in Python
3.6.0: check minimum and maximum years.
|
| |
|
|
|
|
| |
Fix time_hash() function: replace DATE_xxx() macros with TIME_xxx() macros.
Before, the hash function used a wrong value for microseconds if fold is set
(equal to 1).
|
| | |
|
| |
|
|
| |
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
|
| |
|
|
|
|
| |
Introduced platform independent _PyTime_localtime API that is similar
to POSIX localtime_r, but available on all platforms. Patch by Ed
Schouten.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Don't pass "()" format to PyObject_CallXXX() to call a function without
argument: pass NULL as the format string instead. It avoids to have to parse a
string to produce 0 argument.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
|
| |\ \
| |/
| |
| | |
in places where Py_DECREF was used.
|
| |\ \
| |/ |
|
| |\ \
| |/ |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Added an optional argument timespec to the datetime isoformat() method
to choose the precision of the time component.
Original patch by Alessandro Cucci.
|
| | | |
|
| | |
| |
| |
| | |
private functions.
|
| | | |
|
| | | |
|
| |\ \ |
|
| | |\ \
| | |/
| |/| |
|
| | | | |
|
| | |\ \
| | |/ |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
of datetime.datetime: microseconds are now rounded to nearest with ties going
to nearest even integer (ROUND_HALF_EVEN), instead of being rounding towards
zero (ROUND_DOWN). It's important that these methods use the same rounding
mode than datetime.timedelta to keep the property:
(datetime(1970,1,1) + timedelta(seconds=t)) == datetime.utcfromtimestamp(t)
It also the rounding mode used by round(float) for example.
Add more unit tests on the rounding mode in test_datetime.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.
Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.
Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
On Windows, the tv_sec field of the timeval structure has the type C long,
whereas it has the type C time_t on all other platforms. A C long has a size of
32 bits (signed inter, 1 bit for the sign, 31 bits for the value) which is not
enough to store an Epoch timestamp after the year 2038.
Add the _PyTime_AsTimevalTime_t() function written for datetime.datetime.now():
convert a _PyTime_t timestamp to a (secs, us) tuple where secs type is time_t.
It allows to support dates after the year 2038 on Windows.
Enhance also _PyTime_AsTimeval_impl() to detect overflow on the number of
seconds when rounding the number of microseconds.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
datetime.datetime now round microseconds to nearest with ties going to nearest
even integer (ROUND_HALF_EVEN), as round(float), instead of rounding towards
-Infinity (ROUND_FLOOR).
pytime API: replace _PyTime_ROUND_HALF_UP with _PyTime_ROUND_HALF_EVEN. Fix
also _PyTime_Divide() for negative numbers.
_PyTime_AsTimeval_impl() now reuses _PyTime_Divide() instead of reimplementing
rounding modes.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
"""Issue #23517: datetime.timedelta constructor now rounds microseconds to
nearest with ties going away from zero (ROUND_HALF_UP), as Python 2 and Python
older than 3.3, instead of rounding to nearest with ties going to nearest even
integer (ROUND_HALF_EVEN)."""
datetime.timedelta uses rounding mode ROUND_HALF_EVEN again.
|
| | | | |
|
| | | |
| | |
| | |
| | | |
It is very unlikely that they can occur in real code for now.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
datetime.datetime now round microseconds to nearest with ties going away from
zero (ROUND_HALF_UP), as Python 2 and Python older than 3.3, instead of
rounding towards -Infinity (ROUND_FLOOR).
|
| | | |
| | |
| | |
| | |
| | |
| | | |
with ties going away from zero (ROUND_HALF_UP), as Python 2 and Python older
than 3.3, instead of rounding to nearest with ties going to nearest even
integer (ROUND_HALF_EVEN).
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Issue #23517: the change broke test_datetime. datetime.timedelta() rounding
mode must also be changed, and test_datetime must be updated for the new
rounding mode (half up).
|
| | | |
| | |
| | |
| | |
| | |
| | | |
datetime.datetime.utcfromtimestamp() now rounds to nearest with ties going away
from zero, instead of rounding towards minus infinity (-inf), as Python 2 and
Python older than 3.3.
|