bpo-31827: Remove os.stat_float_times() (GH-4061)

This commit is contained in:
Victor Stinner 2017-10-24 02:02:00 -07:00 committed by GitHub
parent 87d332dcdb
commit 01b5aab7bf
7 changed files with 13 additions and 99 deletions

View file

@ -192,23 +192,17 @@ the :mod:`glob` module.)
.. function:: getatime(path)
Return the time of last access of *path*. The return value is a number giving
Return the time of last access of *path*. The return value is a floating point number giving
the number of seconds since the epoch (see the :mod:`time` module). Raise
:exc:`OSError` if the file does not exist or is inaccessible.
If :func:`os.stat_float_times` returns ``True``, the result is a floating point
number.
.. function:: getmtime(path)
Return the time of last modification of *path*. The return value is a number
Return the time of last modification of *path*. The return value is a floating point number
giving the number of seconds since the epoch (see the :mod:`time` module).
Raise :exc:`OSError` if the file does not exist or is inaccessible.
If :func:`os.stat_float_times` returns ``True``, the result is a floating point
number.
.. versionchanged:: 3.6
Accepts a :term:`path-like object`.

View file

@ -2335,8 +2335,6 @@ features:
* the time of creation on Windows, expressed in nanoseconds as an
integer.
See also the :func:`stat_float_times` function.
.. note::
The exact meaning and resolution of the :attr:`st_atime`,
@ -2431,33 +2429,6 @@ features:
Added the :attr:`st_file_attributes` member on Windows.
.. function:: stat_float_times([newvalue])
Determine whether :class:`stat_result` represents time stamps as float objects.
If *newvalue* is ``True``, future calls to :func:`~os.stat` return floats, if it is
``False``, future calls return ints. If *newvalue* is omitted, return the
current setting.
For compatibility with older Python versions, accessing :class:`stat_result` as
a tuple always returns integers.
Python now returns float values by default. Applications which do not work
correctly with floating point time stamps can use this function to restore the
old behaviour.
The resolution of the timestamps (that is the smallest possible fraction)
depends on the system. Some systems only support second resolution; on these
systems, the fraction will always be zero.
It is recommended that this setting is only changed at program startup time in
the *__main__* module; libraries should never change this setting. If an
application uses a library that works incorrectly if floating point time stamps
are processed, this application should turn the feature off until the library
has been corrected.
.. deprecated:: 3.3
.. function:: statvfs(path)
Perform a :c:func:`statvfs` system call on the given path. The return value is