Issue #1261 resolved

autosummary and Python 3 problem

created an issue

I have a problem building a sphinx project with Python 3. The project uses autosummary and the :toctree: directive, an example file is here:

When I try to build the project I get the error:

  File "/usr/local/lib/python3.2/dist-packages/Sphinx-1.2b1-py3.2.egg/sphinx/ext/autosummary/", line 104, in generate_autosummary_docs
    for name, path, template_name in sorted(items):
TypeError: unorderable types: NoneType() < str()

This seem to be an error related to the "sorted" function in Python 3. In Python 2 everything is fine. The line in "" is the following:

The next line 105 indicates that some tuple entries might be "None", so sorting should also work with "None" values. Is this a bug in autosummary?

Best, Peter

Comments (6)

  1. pbouda reporter

    Btw, we fixed this temporarily by replacing line 104 of with:

    for name, path, template_name in sorted(items,key=lambda x: str(x)):

    I am not sure if this is the intended behaviour, but we can then build our documentation also with Python 3.

  2. Log in to comment