Issue 771334: pydoc.TextDoc raises for some kinds of objects (original) (raw)

TextDoc.spill calls inherited Doc.document(getattr(object, name), name, mod, object) Doc.document builds args=(getattr(object, name), name, mod, object) Doc.document calls TextDoc.docother(self, *args) args[3] maps to maxlen=None in TextDoc.docother.. which expects it to be an integer (I think 70 in the other spill functions), but it's really just an arbitrary object.. so an exception gets thrown.

TextDoc.spill (line 1064) should be changed to call self.document(getattr(object, name), name, mod) instead, as the object is not appropriate to be used as maxlen.