Ivan Levkivskyi <[email protected]> added the comment:
Hm, replacing the return with a random string, this leads to another crash:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ilevkivskyi/src/cpython/Lib/_sitebuiltins.py", line 103, in
__call__
return pydoc.help(*args, **kwds)
File "/Users/ilevkivskyi/src/cpython/Lib/pydoc.py", line 1895, in __call__
self.help(request)
File "/Users/ilevkivskyi/src/cpython/Lib/pydoc.py", line 1954, in help
else: doc(request, 'Help on %s:', output=self._output)
File "/Users/ilevkivskyi/src/cpython/Lib/pydoc.py", line 1674, in doc
pager(render_doc(thing, title, forceload))
File "/Users/ilevkivskyi/src/cpython/Lib/pydoc.py", line 1667, in render_doc
return title % desc + '\n\n' + renderer.document(object, name)
File "/Users/ilevkivskyi/src/cpython/Lib/pydoc.py", line 385, in document
if inspect.ismodule(object): return self.docmodule(*args)
File "/Users/ilevkivskyi/src/cpython/Lib/pydoc.py", line 1157, in docmodule
for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
File "/Users/ilevkivskyi/src/cpython/Lib/pkgutil.py", line 123, in
iter_modules
raise ValueError("path must be None or list of paths to look for "
ValueError: path must be None or list of paths to look for modules in
The reason is that `__getattr__` is also triggered when a special attribute is
looked up. I am not sure what to do with this. This is a bit inconsistent with
how classes behave, where e.g. `__len__` is never searched on an instance. But
modules are special in many other ways, so maybe we can just fix pydoc (and
other tools like inspect) to expect some ill-typed values in special module
attributes and fail gracefully?
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue33668>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com