From 16459f730c60154d7429c5e1d0ef9fa07ee51026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=B0=E5=86=A2?= <49506152+BruceLee569@users.noreply.github.com> Date: Sun, 5 Dec 2021 16:17:17 +0800 Subject: [PATCH 1/2] Update os.py In the example of os.walk, a space is required between each sentence to distinguish words. --- Lib/os.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/os.py b/Lib/os.py index ab7ef3c17798b9..b1ea1d3f3bd4b3 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -331,8 +331,8 @@ def walk(top, topdown=True, onerror=None, followlinks=False): import os from os.path import join, getsize for root, dirs, files in os.walk('python/Lib/email'): - print(root, "consumes", end="") - print(sum(getsize(join(root, name)) for name in files), end="") + print(root, "consumes", end=" ") + print(sum(getsize(join(root, name)) for name in files), end=" ") print("bytes in", len(files), "non-directory files") if 'CVS' in dirs: dirs.remove('CVS') # don't visit CVS directories From e5e5a60b82254e0f88d6fdbbd1c00e5e89fd4c2c Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 17 Feb 2022 15:34:00 -0500 Subject: [PATCH 2/2] Simpler fix --- Lib/os.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/os.py b/Lib/os.py index b1ea1d3f3bd4b3..4626d1fc4a9b54 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -331,7 +331,7 @@ def walk(top, topdown=True, onerror=None, followlinks=False): import os from os.path import join, getsize for root, dirs, files in os.walk('python/Lib/email'): - print(root, "consumes", end=" ") + print(root, "consumes ") print(sum(getsize(join(root, name)) for name in files), end=" ") print("bytes in", len(files), "non-directory files") if 'CVS' in dirs: