Author levkivskyi
Recipients Oleg.Oleinik, levkivskyi, tuxtimo
Date 2018-05-31.17:58:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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/", line 103, in __call__
    return*args, **kwds)
  File "/Users/ilevkivskyi/src/cpython/Lib/", line 1895, in __call__
  File "/Users/ilevkivskyi/src/cpython/Lib/", line 1954, in help
    else: doc(request, 'Help on %s:', output=self._output)
  File "/Users/ilevkivskyi/src/cpython/Lib/", line 1674, in doc
    pager(render_doc(thing, title, forceload))
  File "/Users/ilevkivskyi/src/cpython/Lib/", line 1667, in render_doc
    return title % desc + '\n\n' + renderer.document(object, name)
  File "/Users/ilevkivskyi/src/cpython/Lib/", line 385, in document
    if inspect.ismodule(object): return self.docmodule(*args)
  File "/Users/ilevkivskyi/src/cpython/Lib/", line 1157, in docmodule
    for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
  File "/Users/ilevkivskyi/src/cpython/Lib/", 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?
Date User Action Args
2018-05-31 17:58:51levkivskyisetrecipients: + levkivskyi, tuxtimo, Oleg.Oleinik
2018-05-31 17:58:51levkivskyisetmessageid: <>
2018-05-31 17:58:51levkivskyilinkissue33668 messages
2018-05-31 17:58:51levkivskyicreate