sphinx-doc / sphinx-argparse

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

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

Closed mateusfbsoares closed 4 months ago

mateusfbsoares commented 10 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