sphinx-doc / sphinx-argparse

A Sphinx extension to automatically document argparse commands and options
https://sphinx-argparse.readthedocs.org/
MIT License
26 stars 24 forks source link

Exception occured: TypeError: expected str, bytes or os.PathLike object, not NoneType #45

Closed mateusfbsoares closed 5 days ago

mateusfbsoares commented 6 months ago

(this is a necessary duplicate of https://github.com/sphinx-doc/sphinx/issues/11760)

The following code produces the following error:

.. argparse::
   :filename: ../main.py
   :func: main
   :prog: main.py
Exception occurred:
 \.venv\Lib\site-packages\sphinxarg\ext.py", line 448, in _open_filename
    return open(shutil.which(self.options['filename']))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType