From: Hynek Schlawack Date: Thu, 27 Dec 2012 09:20:38 +0000 (+0100) Subject: #16618: Make glob.glob match consistently across strings and bytes X-Git-Tag: v3.4.0a1~1760 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e5c8f992aa48c3790166f09a7baaa5ed01ca318;p=thirdparty%2FPython%2Fcpython.git #16618: Make glob.glob match consistently across strings and bytes Fixes handling of leading dots. Patch by Serhiy Storchaka. --- 6e5c8f992aa48c3790166f09a7baaa5ed01ca318 diff --cc Lib/glob.py index 33ee43bab132,f16e8e16e420..c9f811720a4b --- a/Lib/glob.py +++ b/Lib/glob.py @@@ -55,10 -56,10 +55,10 @@@ def glob1(dirname, pattern) dirname = os.curdir try: names = os.listdir(dirname) - except os.error: + except OSError: return [] - if pattern[0] != '.': - names = [x for x in names if x[0] != '.'] + if not _ishidden(pattern): + names = [x for x in names if not _ishidden(x)] return fnmatch.filter(names, pattern) def glob0(dirname, basename): diff --cc Misc/NEWS index 72ac2b9834ee,9076810d511f..1c9f25f34d1d --- a/Misc/NEWS +++ b/Misc/NEWS @@@ -190,8 -114,9 +190,11 @@@ Core and Builtin Library ------- + - Issue #16618: Make glob.glob match consistently across strings and bytes + regarding leading dots. Patch by Serhiy Storchaka. + +- Issue #16788: Add samestat to Lib/ntpath.py + - Issue #16702: test_urllib2_localnet tests now correctly ignores proxies for localhost tests.