Serhiy Storchaka added the comment:
Patches updated. Unrelated changes removed.
----------
Added file: http://bugs.python.org/file28335/glob_dotfiles_2.patch
Added file: http://bugs.python.org/file28336/glob_tests-2.7_2.patch
_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16618>
_______________________________________
diff -r 2d2d4807a3ed Lib/glob.py
--- a/Lib/glob.py Sun Dec 16 16:40:22 2012 +0100
+++ b/Lib/glob.py Sun Dec 16 21:10:24 2012 +0200
@@ -57,8 +57,8 @@
names = os.listdir(dirname)
except os.error:
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):
@@ -82,3 +82,6 @@
else:
match = magic_check.search(s)
return match is not None
+
+def _ishidden(path):
+ return path[0] in ('.', b'.'[0])
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com