From a0b650add891f32c1e48a46cb0e2f281e1a64fd3 Mon Sep 17 00:00:00 2001 From: 180909 Date: Sun, 3 Apr 2022 04:58:26 +0800 Subject: [PATCH] bpo-45114: Use lstat() instead of stat() in stat docs example (GH-29845) (cherry picked from commit c93a0ac6972221787d8bea1c41a9feb667ed3d2c) Co-authored-by: 180909 --- Doc/library/stat.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stat.rst b/Doc/library/stat.rst index 98219eaee97619..083dc5e3bcfd68 100644 --- a/Doc/library/stat.rst +++ b/Doc/library/stat.rst @@ -109,7 +109,7 @@ Example:: for f in os.listdir(top): pathname = os.path.join(top, f) - mode = os.stat(pathname).st_mode + mode = os.lstat(pathname).st_mode if S_ISDIR(mode): # It's a directory, recurse into it walktree(pathname, callback)