astropy / sphinx-automodapi

Sphinx extension for generating API documentation
https://sphinx-automodapi.readthedocs.io
BSD 3-Clause "New" or "Revised" License
65 stars 45 forks source link

Logging error #109

Open waszil opened 4 years ago

waszil commented 4 years ago

I'm using python 3.7.7, sphinx 3.0.3 and the latest automodapi.

The following problem occurs: I get these kind of warnings: "WARNING: Found additional options members in automodapi" however it causes a logging error: TypeError: not all arguments converted during string formatting

I played around with it and I could fix it by this, as it seems that arguments are passed to the string that have no % formatter placeholders:

Index: automodapi.py
===================================================================
--- automodapi.py   (revision 34799)
+++ automodapi.py   (working copy)
@@ -286,7 +286,7 @@
             # tell sphinx that the remaining args are invalid.
             if len(unknownops) > 0 and app is not None:
                 opsstrs = ','.join(unknownops)
-                msg = 'Found additional options ' + opsstrs + ' in automodapi.'
+                msg = 'Found additional options ' + opsstrs + ' in automodapi. %s'
                 if warnings:
                     logger.warning(msg, location)