[Python-checkins] cpython (3.4): Issue #21520: test_zipfile no longer fails if the word 'bad' appears
larry.hastings
python-checkins at python.org
Fri May 8 15:59:34 CEST 2015
https://hg.python.org/cpython/rev/bff966aed6a3
changeset: 95913:bff966aed6a3
branch: 3.4
parent: 95911:7eb524cbe6e5
user: Larry Hastings <larry at hastings.org>
date: Fri May 08 06:54:58 2015 -0700
summary:
Issue #21520: test_zipfile no longer fails if the word 'bad' appears
anywhere in the name of the current directory.
files:
Lib/test/test_zipfile.py | 5 +++--
Misc/NEWS | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -719,9 +719,10 @@
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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -228,6 +228,9 @@
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.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list