]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #29092: Sync os.stat's doc and docstring on path type.
authorXiang Zhang <angwerzx@126.com>
Sun, 22 Jan 2017 05:04:17 +0000 (13:04 +0800)
committerXiang Zhang <angwerzx@126.com>
Sun, 22 Jan 2017 05:04:17 +0000 (13:04 +0800)
1  2 
Doc/library/os.rst
Modules/clinic/posixmodule.c.h
Modules/posixmodule.c

index 988cb7ca33454d138bbff63b52820e7e0d757763,3aee501cabde5d507747979b7404af162d9ada63..37fa2a2868dac9d7f090dd8e6f3271bf4bd13665
@@@ -2213,8 -2068,7 +2213,8 @@@ features
  
     Get the status of a file or a file descriptor. Perform the equivalent of a
     :c:func:`stat` system call on the given path. *path* may be specified as
-    either a string -- directly or indirectly through the :class:`PathLike`
 -   either a string, a bytes or as an open file descriptor. Return a :class:`stat_result`
++   either a string or bytes -- directly or indirectly through the :class:`PathLike`
 +   interface -- or as an open file descriptor. Return a :class:`stat_result`
     object.
  
     This function normally follows symlinks; to stat a symlink add the argument
index f63a3beabf9ef735ad19e310236117a9a8212748,b3521d81c6aae2765ccacec258d351d881ab8311..0d3ce6eed65d260980a5af7f7c1ca4270c2cf045
@@@ -9,7 -9,7 +9,8 @@@ PyDoc_STRVAR(os_stat__doc__
  "Perform a stat system call on the given path.\n"
  "\n"
  "  path\n"
--"    Path to be examined; can be string, bytes, or open-file-descriptor int.\n"
++"    Path to be examined; can be string, bytes, path-like object or\n"
++"    open-file-descriptor int.\n"
  "  dir_fd\n"
  "    If not None, it should be a file descriptor open to a directory,\n"
  "    and path should be a relative string; path will then be relative to\n"
@@@ -6145,8 -5785,4 +6146,8 @@@ exit
  #ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
      #define OS_SET_HANDLE_INHERITABLE_METHODDEF
  #endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
 -/*[clinic end generated code: output=7690b72549d2524e input=a9049054013a1b77]*/
 +
 +#ifndef OS_GETRANDOM_METHODDEF
 +    #define OS_GETRANDOM_METHODDEF
 +#endif /* !defined(OS_GETRANDOM_METHODDEF) */
- /*[clinic end generated code: output=50cfb7ebc44efb67 input=a9049054013a1b77]*/
++/*[clinic end generated code: output=455def991740915a input=a9049054013a1b77]*/
index 33ee70d8d54e68de4e1def3b7389f924dfd9f8da,3e446a524e9e93e1c4fd5f661691ae27c1e944bf..dc3fb94c87146638019ff7eb3d966a694b7ece10
@@@ -2386,7 -2461,7 +2386,8 @@@ class sched_param_converter(CConverter)
  os.stat
  
      path : path_t(allow_fd=True)
--        Path to be examined; can be string, bytes, or open-file-descriptor int.
++        Path to be examined; can be string, bytes, path-like object or
++        open-file-descriptor int.
  
      *
  
@@@ -2413,7 -2488,7 +2414,7 @@@ It's an error to use dir_fd or follow_s
  
  static PyObject *
  os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks)
--/*[clinic end generated code: output=7d4976e6f18a59c5 input=099d356c306fa24a]*/
++/*[clinic end generated code: output=7d4976e6f18a59c5 input=270bd64e7bb3c8f7]*/
  {
      return posix_do_stat("stat", path, dir_fd, follow_symlinks);
  }