Skip to content

Commit 8fbec18

Browse files
committed
Fix issue2550493: hide 'hidden' files.
1 parent 01a34bc commit 8fbec18

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

roundup/init.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
def copytree(src, dst, symlinks=0):
3131
"""Recursively copy a directory tree using copyDigestedFile().
3232
33-
The destination directory os allowed to exist.
33+
The destination directory is allowed to exist.
3434
3535
If the optional symlinks flag is true, symbolic links in the
3636
source tree result in symbolic links in the destination tree; if
@@ -39,7 +39,9 @@ def copytree(src, dst, symlinks=0):
3939
4040
This was copied from shutil.py in std lib.
4141
"""
42-
names = os.listdir(src)
42+
43+
# Prevent 'hidden' files (those starting with '.') from being considered.
44+
names = [f for f in os.listdir(src) if not f.startswith('.')]
4345
try:
4446
os.mkdir(dst)
4547
except OSError, error:

run_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ def walk_with_symlinks(top, func, arg):
448448
cycles in your Zope sandbox, so don't do that.
449449
"""
450450
try:
451-
names = os.listdir(top)
451+
# Prevent 'hidden' files (those starting with '.') from being considered.
452+
names = [f for f in os.listdir(top) if not f.startswith('.')]
452453
except os.error:
453454
return
454455
func(arg, top, names)

0 commit comments

Comments
 (0)