Issue #17923: glob() patterns ending with a slash no longer match non-dirs on

AIX.  Based on patch by Delhallt.
This commit is contained in:
Serhiy Storchaka 2014-08-12 12:55:12 +03:00
parent c04d468333
commit 6f20170762
2 changed files with 12 additions and 4 deletions

View File

@ -26,11 +26,16 @@ def iglob(pathname):
patterns.
"""
if not has_magic(pathname):
if os.path.lexists(pathname):
yield pathname
return
dirname, basename = os.path.split(pathname)
if not has_magic(pathname):
if basename:
if os.path.lexists(pathname):
yield pathname
else:
# Patterns ending with a slash should match only directories
if os.path.isdir(dirname):
yield pathname
return
if not dirname:
yield from glob1(None, basename)
return

View File

@ -27,6 +27,9 @@ Core and Builtins
Library
-------
- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX. Based on patch by Delhallt.
- Issue #21121: Don't force 3rd party C extensions to be built with
-Werror=declaration-after-statement.