[issue11914] pydoc modules/help('modules') crash in dirs with unreadable subdirs

2011-04-23 Thread Ben Okopnik
New submission from Ben Okopnik : Long-standing problem (happens in every Python version I've tested). The usual situation is when invoking Python (and then "help('modules')") or "pydoc modules" in /tmp, but also happens when located anywhere with unreadabl

[issue11914] pydoc modules/help('modules') crash in dirs with unreadable subdirs

2011-04-27 Thread Ben Okopnik
Ben Okopnik added the comment: Here's a test that should exercise every version of "pydoc" installed on the system: mkdir -p /tmp/foo/bar; cd /tmp/foo; chmod 0 bar for n in `whereis -b pydoc`; do echo " $n "; $n modules; done Tested under Ubuntu with bash

[issue11914] pydoc modules/help('modules') crash in dirs with unreadable subdirs

2011-04-27 Thread Ben Okopnik
Ben Okopnik added the comment: Trivial fix: please see attached. As to test_pydoc.py, I don't know the system well enough to fiddle with it, but something like this should work (untested): def test_unreadable_dir(self): ''' pydoc should handle unreadabl

[issue11914] pydoc modules/help('modules') crash in dirs with unreadable subdirs

2011-04-27 Thread Ben Okopnik
Ben Okopnik added the comment: Whoops... with all of that, I just realized that this bug should be filed against pkgutil, not pydoc (pydoc, of course, calls pkgutil to do the path resolution, which is where this crash occurs.) My bad. >>> import pkgutil >>> inst = pkguti