changeset: 92080:6a71d3c79653 parent: 92077:d2041159e8ed parent: 92079:5033589a752d user: Serhiy Storchaka date: Tue Aug 12 12:56:25 2014 +0300 files: 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 d2041159e8ed -r 6a71d3c79653 Lib/glob.py --- a/Lib/glob.py Mon Aug 11 21:41:46 2014 -0400 +++ b/Lib/glob.py Tue Aug 12 12:56:25 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 d2041159e8ed -r 6a71d3c79653 Misc/NEWS --- a/Misc/NEWS Mon Aug 11 21:41:46 2014 -0400 +++ b/Misc/NEWS Tue Aug 12 12:56:25 2014 +0300 @@ -115,6 +115,9 @@ Library ------- +- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on + AIX. Based on patch by Delhallt. + - Issue #21725: Added support for RFC 6531 (SMTPUTF8) in smtpd. - Issue #22176: Update the ctypes module's libffi to v3.1. This release