autosummary and Python 3 problem

pbouda avatarpbouda 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 (4)

  1. pbouda

    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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.