From: Larry Hastings Date: Fri, 8 May 2015 13:54:58 +0000 (-0700) Subject: Issue #21520: test_zipfile no longer fails if the word 'bad' appears X-Git-Tag: v3.5.0b1~226^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e63b36f7f6975b3d7590fc1c12caf04c39b2e7e;p=thirdparty%2FPython%2Fcpython.git Issue #21520: test_zipfile no longer fails if the word 'bad' appears anywhere in the name of the current directory. --- diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 3d8f9bc9c7bf..0c4c5791c480 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -719,9 +719,10 @@ class PyZipFileTests(unittest.TestCase): self.assertTrue('SyntaxError' not in reportStr) # then check that the filter works on individual files + def filter(path): + return not os.path.basename(path).startswith("bad") with captured_stdout() as reportSIO, self.assertWarns(UserWarning): - zipfp.writepy(packagedir, filterfunc=lambda fn: - 'bad' not in fn) + zipfp.writepy(packagedir, filterfunc=filter) reportStr = reportSIO.getvalue() if reportStr: print(reportStr) diff --git a/Misc/NEWS b/Misc/NEWS index 333aa43d889f..79c705cd5b8c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -228,6 +228,9 @@ Library Tests ----- +- Issue #21520: test_zipfile no longer fails if the word 'bad' appears + anywhere in the name of the current directory. + - Issue #23799: Added test.support.start_threads() for running and cleaning up multiple threads.