From 2a4f777adab058ec1669aeb328378b42a5327fa0 Mon Sep 17 00:00:00 2001 From: stefan Date: Mon, 9 Feb 2009 17:47:12 +0000 Subject: [PATCH] Fix issue2550493: hide 'hidden' files. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4117 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/init.py | 6 ++++-- run_tests.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roundup/init.py b/roundup/init.py index 8506f22..7ecba91 100644 --- a/roundup/init.py +++ b/roundup/init.py @@ -30,7 +30,7 @@ from roundup.i18n import _ def copytree(src, dst, symlinks=0): """Recursively copy a directory tree using copyDigestedFile(). - The destination directory os allowed to exist. + The destination directory is allowed to exist. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if @@ -39,7 +39,9 @@ def copytree(src, dst, symlinks=0): This was copied from shutil.py in std lib. """ - names = os.listdir(src) + + # Prevent 'hidden' files (those starting with '.') from being considered. + names = [f for f in os.listdir(src) if not f.startswith('.')] try: os.mkdir(dst) except OSError, error: diff --git a/run_tests.py b/run_tests.py index c543753..d84f590 100644 --- a/run_tests.py +++ b/run_tests.py @@ -448,7 +448,8 @@ def walk_with_symlinks(top, func, arg): cycles in your Zope sandbox, so don't do that. """ try: - names = os.listdir(top) + # Prevent 'hidden' files (those starting with '.') from being considered. + names = [f for f in os.listdir(top) if not f.startswith('.')] except os.error: return func(arg, top, names) -- 2.30.2