Hi Ned, > Issue #7367: Add test case to test_pkgutil for walking path with > an unreadable directory. Kudos for fixing this bug, the pydoc one and cleaning the duplicate reports!
> diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py > --- a/Lib/test/test_pkgutil.py > +++ b/Lib/test/test_pkgutil.py > @@ -78,6 +78,17 @@ > + def test_unreadable_dir_on_syspath(self): > + # issue7367 - walk_packages failed if unreadable dir on sys.path > + package_name = "unreadable_package" > + d = os.path.join(self.dirname, package_name) > + # this does not appear to create an unreadable dir on Windows > + # but the test should not fail anyway > + os.mkdir(d, 0) > + for t in pkgutil.walk_packages(path=[self.dirname]): > + self.fail("unexpected package found") > + os.rmdir(d) This should use a try/finally block (or self.addCleanup, my preference) to make sure rmdir is always called. Regards _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com