mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #22117: Fix os.utime(), it now rounds the timestamp towards minus
infinity (-inf) instead of rounding towards zero. Replace _PyTime_ROUND_DOWN with _PyTime_ROUND_FLOOR.
This commit is contained in:
parent
f81f0f9c63
commit
dca028b86a
2 changed files with 5 additions and 2 deletions
|
@ -6127,9 +6127,9 @@ os_utime_impl(PyModuleDef *module, path_t *path, PyObject *times, PyObject *ns,
|
|||
}
|
||||
utime.now = 0;
|
||||
if (_PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 0),
|
||||
&a_sec, &a_nsec, _PyTime_ROUND_DOWN) == -1 ||
|
||||
&a_sec, &a_nsec, _PyTime_ROUND_FLOOR) == -1 ||
|
||||
_PyTime_ObjectToTimespec(PyTuple_GET_ITEM(times, 1),
|
||||
&m_sec, &m_nsec, _PyTime_ROUND_DOWN) == -1) {
|
||||
&m_sec, &m_nsec, _PyTime_ROUND_FLOOR) == -1) {
|
||||
goto exit;
|
||||
}
|
||||
utime.atime_s = a_sec;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue