Sphinx: Error in "currentmodule", autosummary extension

Created on 5 Oct 2015  路  6Comments  路  Source: sphinx-doc/sphinx

I'm getting the following error on latest Sphinx from PyPI on Python 2.7, both Mac and Linux:

/var/lib/jenkins/jobs/wiki-cb1805f95166/workspace/venv/lib/python2.7/site-packages/sphinx/ext/autosummary/templates/autosummary/class.rst:4: ERROR: Error in "currentmodule" directive:
maximum 1 argument(s) allowed, 3 supplied.

.. currentmodule:: {{ module }}

Looks like it interprets {{ module }} literally, as 3 arguments, instead of interpolating it first.

question

Most helpful comment

I encountered this same error; I determined that for me, it was because Sphinx was finding the venv/ I created in my package directory and was unsurprisingly unable to parse any Python source code from it.

Moving venv/ out of that directory resolved my case. I suspect that adding 'venv' to exclude_patterns in conf.py would have also resolved my case.

All 6 comments

It's strange. It seems Sphinx processed a template file of autosummary module.
How did you invoke sphinx-build? I guess Makefile or build scripts are not good.

Any comment? If none, I'll close this later.

I'm closing this now.
Please feel free to reopen if you still get same error.
Thanks,

I encountered this same error; I determined that for me, it was because Sphinx was finding the venv/ I created in my package directory and was unsurprisingly unable to parse any Python source code from it.

Moving venv/ out of that directory resolved my case. I suspect that adding 'venv' to exclude_patterns in conf.py would have also resolved my case.

I had the same problem as @convoliution and can confirm that adding the virtual environment directory to the exclude_patterns in conf.py solves the issue.

Thank you for reporting. I understand what happened. If you put venv directory under sphinx project, Sphinx searches source files from it. And it considers a template file of autosummary module as a source file.

As you commented, please mark the venv dir as excluded. Then it will be resolved.
Thanks,

Was this page helpful?
0 / 5 - 0 ratings