goerz/better-apidoc

Error from using sphinx.utils.walk

theRealSuperMario opened this issue · 1 comments

Hi,

I was running into the following error

Running Sphinx v4.0.0
making output directory... done
[autosummary] generating autosummary for: XXX

Extension error:
Handler <function run_apidoc at 0x7f83a4aa1550> for event 'builder-inited' threw an exception (exception: cannot import name 'walk' from 'sphinx.util.osutil' (XXX/lib/python3.8/site-packages/sphinx/util/osutil.py))
make: *** [html] Error 2

Turns out the problem comes from import better_apidoc in conf.py. The fix is extremely simple: just don't use the walk from sphinx, but use os.walk.

https://github.com/goerz/better-apidoc/blob/master/better_apidoc.py#L39

As it turns out, sphinx.utils.walk is deprecated anyway. See https://www.sphinx-doc.org/en/master/changes.html#id96.

Do you guys think it is a good idea to fix this?

goerz commented

Definitely! I'll have to make a compatibility update for Sphinx 4.0.

Thanks for reporting, and contributing the fix!