Closed NucleaPeon closed 4 years ago
Thank you for reporting. The attached error log says Sphinx was crashed in processing a singledispatch function. Does your module contain a singledispatch function?
Does your module contain a singledispatch function?
If you're referring to the namespace module code I posted, then no. It's only relying on official python libraries. I don't think defaultdict
uses a singledispatch and I did look at some of the source for it. We have other places where we use argparse
and Namespace
and we don't get that error so I don't think those are responsible.
Part of how I tested was I found the overall sub-module in the codebase that was producing the stacktrace, then I moved out all the modules and slowly added them back in until I found which module caused it. Perhaps it's in conjunction with another module, I don't know, but that's how I arrived at the above issue.
We do have singledispatch-enabled functions in our codebase, it's mostly used in json encoding for serialization and our json python module isn't producing the stacktrace, at least without our namespace one. I wish I could be more help, let me know what else I can try or if you need more information.
@NucleaPeon Could you confirm this PR https://github.com/sphinx-doc/sphinx/pull/7797 resolves your problem?
You can install it by pip install git+https://github.com/tk0miya/sphinx.git@7791_TypeError_for_singledispatchfunction
I merged #7797 and going to release it as 3.1.0. Could you check the new package, please? And please let me know if not working fine.
Looks like we got further!
Running Sphinx v3.1.0
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 41 source files that are out of date
updating environment: [new config] 41 added, 0 changed, 0 removed
reading sources... [ 87%] ...
Exception occurred:
File "/home/danielk/.local/lib/python3.7/site-packages/sphinx/ext/autodoc/__init__.py", line 1240, in annotate_to_first_argument
func.__signature__ = sig.replace(parameters=params) # type: ignore
TypeError: can't set attributes of built-in/extension type 'list'
The full traceback has been saved in /tmp/sphinx-err-lf0wsvvp.log
, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make[1]: *** [Makefile:20: html] Error 2
make[1]: Leaving directory '/home/danielk/Development/docs'
make: *** [Makefile:85: docs] Error 2
Should I refile the issue? Not sure I can reopen this issue.
Could you file a new issue, please? It seems the error is not related to this.
Note: The error log says autofunction
diretive takes an overloaded function. But it failed to update the __signature__
attribute because given function is a built-in class list
(or similar type). I don't understand why list
like class is passed to the overloaded function. Anyway, we should handle the TypeError here.
Describe the bug Running sphinx-build after sphinx-apidoc on our codebase results in the error message:
The exact command I ran is
make html
with everything set up and the.rst
s generated.To Reproduce
make html
Due to the specifics and the company I work for, I am unable to provide a complete code example, but I can provide the module in its entirety that it was tripping up on and it doesn't contain specifics.
Expected behavior No errors when running
make html
Your project n/a
Environment info
Additional context See attachment
sphinx-err-wzrazkn1.log