Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e63b36

Browse files
committed
Issue #21520: test_zipfile no longer fails if the word 'bad' appears
anywhere in the name of the current directory.
1 parent b79e012 commit 7e63b36

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/test/test_zipfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,10 @@ def test_write_filtered_python_package(self):
719719
self.assertTrue('SyntaxError' not in reportStr)
720720

721721
# then check that the filter works on individual files
722+
def filter(path):
723+
return not os.path.basename(path).startswith("bad")
722724
with captured_stdout() as reportSIO, self.assertWarns(UserWarning):
723-
zipfp.writepy(packagedir, filterfunc=lambda fn:
724-
'bad' not in fn)
725+
zipfp.writepy(packagedir, filterfunc=filter)
725726
reportStr = reportSIO.getvalue()
726727
if reportStr:
727728
print(reportStr)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ Library
228228
Tests
229229
-----
230230

231+
- Issue #21520: test_zipfile no longer fails if the word 'bad' appears
232+
anywhere in the name of the current directory.
233+
231234
- Issue #23799: Added test.support.start_threads() for running and
232235
cleaning up multiple threads.
233236

0 commit comments

Comments
 (0)