From 3491ad989087b1d227dbf697e161630dc0d787d8 Mon Sep 17 00:00:00 2001 From: Abdulrahman Alrahma Date: Mon, 27 Jan 2025 16:26:18 +0000 Subject: [PATCH 1/2] gh-129350: remove potential bad copy paste --- Lib/glob.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Lib/glob.py b/Lib/glob.py index 690ab1b8b9fb1d..0c7977dbcd395e 100644 --- a/Lib/glob.py +++ b/Lib/glob.py @@ -71,22 +71,25 @@ def _iglob(pathname, root_dir, dir_fd, recursive, dironly, else: # Patterns ending with a slash should match only directories if _isdir(_join(root_dir, dirname), dir_fd): - yield pathname + yield dirname return if not dirname: if recursive and _isrecursive(basename): - yield from _glob2(root_dir, basename, dir_fd, dironly, - include_hidden=include_hidden) + yield from _glob2( + root_dir, basename, dir_fd, dironly, include_hidden=include_hidden + ) else: - yield from _glob1(root_dir, basename, dir_fd, dironly, - include_hidden=include_hidden) + yield from _glob1( + root_dir, basename, dir_fd, dironly, include_hidden=include_hidden + ) return # `os.path.split()` returns the argument itself as a dirname if it is a # drive or UNC path. Prevent an infinite recursion if a drive or UNC path # contains magic characters (i.e. r'\\?\C:'). if dirname != pathname and has_magic(dirname): - dirs = _iglob(dirname, root_dir, dir_fd, recursive, True, - include_hidden=include_hidden) + dirs = _iglob( + dirname, root_dir, dir_fd, recursive, True, include_hidden=include_hidden + ) else: dirs = [dirname] if has_magic(basename): From becf4beade32f515f50c3f209cb298d04e31a285 Mon Sep 17 00:00:00 2001 From: Abdulrahman Alrahma Date: Mon, 27 Jan 2025 16:33:53 +0000 Subject: [PATCH 2/2] add blurb --- .../next/Library/2025-01-27-16-33-37.gh-issue-129350.cdJ4cX.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-01-27-16-33-37.gh-issue-129350.cdJ4cX.rst diff --git a/Misc/NEWS.d/next/Library/2025-01-27-16-33-37.gh-issue-129350.cdJ4cX.rst b/Misc/NEWS.d/next/Library/2025-01-27-16-33-37.gh-issue-129350.cdJ4cX.rst new file mode 100644 index 00000000000000..b765e9e06187d8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-01-27-16-33-37.gh-issue-129350.cdJ4cX.rst @@ -0,0 +1 @@ +Fix potential bad copy paste