cos-archives / modular-odm

A database-agnostic Object-Document Mapper for Python.
Apache License 2.0
13 stars 18 forks source link

ModularODM raises an exception on help calls #112

Closed abought closed 9 years ago

abought commented 9 years ago

Attempting to get help when using ModularODM from a shell raises an exception in Pydoc. See stack trace below, based on the "User" model in centerforopenscience/osf.io.

Probably minor, but noting for posterity.

$ workon osf; inv shell
>>> help(User)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/andyboughton/code/cos/osf.io/env/bin/../lib/python2.7/site.py", line 505, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1787, in __call__
    self.help(request)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1834, in help
    else: doc(request, 'Help on %s:')
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1571, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1566, in render_doc
    return title % desc + '\n\n' + text.document(object, name)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 361, in document
    if inspect.isclass(object): return self.docclass(*args)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1279, in docclass
    lambda t: t[1] == 'data')
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1245, in spilldata
    name, mod, maxlen=70, doc=doc) + '\n')
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1358, in docother
    repr = self.repr(object)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/repr.py", line 24, in repr
    return self.repr1(x, self.maxlevel)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1006, in repr1
    return getattr(self, methodname)(x, level)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/repr.py", line 58, in repr_list
    return self._repr_iterable(x, level, '[', ']', self.maxlist)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/repr.py", line 48, in _repr_iterable
    pieces = [repr1(elem, newlevel) for elem in islice(x, maxiter)]
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1007, in repr1
    return cram(stripid(repr(x)), self.maxother)
TypeError: __repr__ returned non-string (type Cursor)