Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mateusfbsoares opened this issue Jan 22, 2024 · 0 comments
Labels
good first issue Good for newcomers

Comments

@mateusfbsoares
Copy link

(this is a necessary duplicate of sphinx-doc/sphinx#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
@ashb ashb added the good first issue Good for newcomers label May 1, 2024
Ovank added a commit to Ovank/sphinx-argparse that referenced this issue May 18, 2024
Fixes issue sphinx-doc#45

Code is not equipped to handle scenario when 
```shutil.which``` return *None*. 
Adding ```TypeError``` Exception to the error handling.
ashb pushed a commit that referenced this issue May 19, 2024
Fixes issue #45

Code is not equipped to handle scenario when 
```shutil.which``` return *None*. 
Adding ```TypeError``` Exception to the error handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants