[New-bugs-announce] [issue15816] pydoc.py uses a hack that depends on implementation details and breaks help() when __builtin__.__import__ is overwritten.
David Kreuter
report at bugs.python.org
Wed Aug 29 21:45:15 CEST 2012
New submission from David Kreuter:
help("compile") # this works
import __builtin__
real_import = __import__
__builtin__.__import__ = lambda *a: real_import(*a)
help("compile") # this fails
The line responsible for this is in pydoc.py around line 300:
... elif exc is ImportError and extract_tb(tb)[-1][2]=='safeimport': ...
----------
components: Library (Lib)
messages: 169412
nosy: dkreuter
priority: normal
severity: normal
status: open
title: pydoc.py uses a hack that depends on implementation details and breaks help() when __builtin__.__import__ is overwritten.
versions: Python 2.7, Python 3.1, Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15816>
_______________________________________
More information about the New-bugs-announce
mailing list