summaryrefslogtreecommitdiff
path: root/Lib/test/test_pkgutil.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-10-06 14:24:31 -0700
committerNed Deily <nad@acm.org>2011-10-06 14:24:31 -0700
commit94030712770513a26bbe80346168b340dc6a16f3 (patch)
treec914f1293ea51c570b92b7450849ecd1316f0e6d /Lib/test/test_pkgutil.py
parent17a332ac1b6206a42e6a737dc7d995e5fcffdcba (diff)
parented27df7aaa844d124d8ee25aa93ef74dfac5b191 (diff)
downloadcpython-git-94030712770513a26bbe80346168b340dc6a16f3.tar.gz
merge from 3.2
Diffstat (limited to 'Lib/test/test_pkgutil.py')
-rw-r--r--Lib/test/test_pkgutil.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py
index f69af5a86b..f755e67464 100644
--- a/Lib/test/test_pkgutil.py
+++ b/Lib/test/test_pkgutil.py
@@ -84,6 +84,17 @@ class PkgutilTests(unittest.TestCase):
del sys.modules[pkg]
+ 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)
+
class PkgutilPEP302Tests(unittest.TestCase):
class MyTestLoader(object):