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:54:55 +03:00
parent 67310859d1
commit 3fdffc9fb6
2 changed files with 12 additions and 4 deletions

View File

@ -35,11 +35,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:
for name in glob1(os.curdir, basename):
yield name

View File

@ -19,6 +19,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 #21975: Fixed crash when using uninitialized sqlite3.Row (in particular
when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in the
__new__() method.