Issue 14022: bug in pkgutil.py with suggested fix (original) (raw)

Issue14022

Created on 2012-02-15 17:18 by dfwc, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg153421 - (view) Author: Don Caldwell (dfwc) Date: 2012-02-15 17:18
in iter_modules there is a loop for fn in os.listdir(path): that can fail on an OSError exception. here is a patch try: for fn in os.listdir(path): subname = inspect.getmodulename(fn) if subname=='__init__': ispkg = True break else: continue # not a package except OSError as (errno, strerror): print "%s: %s\n" % (fn, strerror)
msg153427 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2012-02-15 18:56
This issue was recently fixed by the changes for Issue7367 and will be released in Python 2.7.3 and 3.2.3. Python 2.6 no longer receives bug fixes, only security fixes.
History
Date User Action Args
2022-04-11 14:57:26 admin set github: 58230
2012-02-15 18:56:21 ned.deily set status: open -> closedsuperseder: pkgutil.walk_packages fails on write-only directory in sys.pathnosy: + ned.deilymessages: + resolution: out of datestage: resolved
2012-02-15 17🔞30 dfwc create