changeset: 92079:5033589a752d branch: 3.4 parent: 92076:df832e0c6d7d user: Serhiy Storchaka date: Tue Aug 12 12:55:12 2014 +0300 files: Lib/glob.py Misc/NEWS description: Issue #17923: glob() patterns ending with a slash no longer match non-dirs on AIX. Based on patch by Delhallt. diff -r df832e0c6d7d -r 5033589a752d Lib/glob.py --- a/Lib/glob.py Mon Aug 11 21:40:38 2014 -0400 +++ b/Lib/glob.py Tue Aug 12 12:55:12 2014 +0300 @@ -26,11 +26,16 @@ patterns. """ + dirname, basename = os.path.split(pathname) if not has_magic(pathname): - if os.path.lexists(pathname): - yield 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 - dirname, basename = os.path.split(pathname) if not dirname: yield from glob1(None, basename) return diff -r df832e0c6d7d -r 5033589a752d Misc/NEWS --- a/Misc/NEWS Mon Aug 11 21:40:38 2014 -0400 +++ b/Misc/NEWS Tue Aug 12 12:55:12 2014 +0300 @@ -27,6 +27,9 @@ 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.