[issue14638] pydoc error on instance of a custom class

Florent Xicluna report at bugs.python.org
Fri Apr 20 22:45:23 CEST 2012


New submission from Florent Xicluna <florent.xicluna at gmail.com>:

pydoc fails on custom instances in specific cases. (When instance __name__ does not resolve to a str).

This is a small example:

>>> import pydoc
>>> class A:
...   def __getattr__(self, name):
...     return True
... 
>>> print(pydoc.render_doc(A))
Python Library Documentation: class A in module __main__
(...)
>>> print(pydoc.render_doc(A()))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./Lib/pydoc.py", line 1534, in render_doc
    if name and '.' in name:
TypeError: argument of type 'bool' is not iterable

----------
components: Library (Lib)
messages: 158887
nosy: flox
priority: normal
severity: normal
status: open
title: pydoc error on instance of a custom class
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14638>
_______________________________________


More information about the Python-bugs-list mailing list