[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2011-10-07 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 17b5afd321a8 by Ned Deily in branch '2.7':
Issue #7367: Ensure test directory always gets removed.
http://hg.python.org/cpython/rev/17b5afd321a8

New changeset ff72f76dcf43 by Ned Deily in branch '3.2':
Issue #7367: Ensure test directory always gets removed.
http://hg.python.org/cpython/rev/ff72f76dcf43

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2011-10-06 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 096b010ae90b by Ned Deily in branch '2.7':
Issue #7367: Add test case to test_pkgutil for walking path with
http://hg.python.org/cpython/rev/096b010ae90b

New changeset 1449095397ae by Ned Deily in branch '2.7':
Issue #7367: Fix pkgutil.walk_paths to skip directories whose
http://hg.python.org/cpython/rev/1449095397ae

New changeset a1e6633ef3f1 by Ned Deily in branch '3.2':
Issue #7367: Add test case to test_pkgutil for walking path with
http://hg.python.org/cpython/rev/a1e6633ef3f1

New changeset 77bac85f610a by Ned Deily in branch '3.2':
Issue #7367: Fix pkgutil.walk_paths to skip directories whose
http://hg.python.org/cpython/rev/77bac85f610a

New changeset 5a4018570a59 by Ned Deily in branch '3.2':
Issue #7367: add NEWS item.
http://hg.python.org/cpython/rev/5a4018570a59

New changeset 0408001e4765 by Ned Deily in branch 'default':
Issue #7367: merge from 3.2
http://hg.python.org/cpython/rev/0408001e4765

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2011-10-06 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

The applied changesets correct pkgutil's walk_packages for classic imports to 
ignore unreadable directories the same way that the interpreter's import does.  
With this fix to pkgutil, pydoc -k also no longer fails in this case.  Applied 
in 2.7 (for 2.7.3), 3.2 (for 3.2.3), and default (for 3.3.0).

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2011-08-05 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
assignee:  - ned.deily

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2011-08-05 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
versions: +Python 3.3 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2010-11-21 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
keywords: +easy
stage:  - needs patch
versions:  -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2009-11-20 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I initially came across the error when attempting to get a modules list
and was returned a list of errors. One of them was the [errno 13].

OK, now that makes more sense!

The problem is that somehow you had a write-only directory (~/Public/Drop 
Box) on your python module search path.  If you type the following commands 
in IDLE or in the interpreter:

import sys
sys.path

you will likely see the Drop Box directory in the list of paths (assuming 
things haven't changed).

When you run the modules help command, the python help module, pydoc, uses 
the pkgutil module to search the entire list of directories in sys.path and 
attempts to import each package it finds in each directory to print the 
module's help information (btw, there are no separate help files).

While the pkgutil.walk_packages function tries to handle most errors, it 
isn't prepared to handle the case of a write-only directory on sys.path and 
that's the root cause of the error of the error you saw.  The following test 
case demonstrates the problem:

import os, pkgutil, sys

dirname_wo = os.tempnam()
os.mkdir(dirname_wo, 0222)  # write permission only
try:
sys.path.insert(0, dirname_wo)
def onerror(pkgname):
print('onerror called for package %s' % pkgname)
for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
print modname
finally:
os.rmdir(dirname_wo)

The long-term solution is to have pkgutil.walk_packages protect itself 
against os.listdir errors.  A patch is needed for that.

In your case, though, you should check for and remove whatever is adding 
Drop Box to your Python sys.path.  Perhaps you have an out-of-date export 
of PYTHONPATH in a shell profile (.bash_profile, etc)?  Or something left 
over in a site-packages pth file (perhaps by trying to install a package 
from the Drop Box directory)?  By changing the permissions as you did, you 
worked around the problem but that's not the right solution and you could be 
compromising the security of your drop box file.

--
components: +Library (Lib) -IDLE
title: IDLE OSError [errno 13] permission denied accessing help files - 
pkgutil.walk_packages fails on write-only directory in sys.path
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7367] pkgutil.walk_packages fails on write-only directory in sys.path

2009-11-20 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

More precisely: you should check for and remove whatever is adding 
Drop Box or a directory within it to your Python sys.path.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7367
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com