hynek / doc2dash

Create docsets for Dash.app-compatible API browsers.
https://doc2dash.hynek.me/
MIT License
558 stars 38 forks source link

Doc path is binary instead of string #166

Closed VadeveSi closed 11 months ago

VadeveSi commented 11 months ago

Hi,

I am using Python 3.11, doc2dash 3.0.0 (downloaded with pip) and Sphinx 4.2.0. When I run doc2dash . inside my html build folder, the command fails due to path being encoded as bytes. While the fix is pretty simple (decode the path string), I couldn't get doc2dash running locally to test it. I am not familiar with

doc2dash .
Traceback (most recent call last):
  File "[...]/bin/doc2dash", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "[...]/lib/python3.11/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/doc2dash/__main__.py", line 186, in main
    parser_type, detected_name = parsers.get_doctype(source)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/doc2dash/parsers/__init__.py", line 23, in get_doctype
    name = dt.detect(path)
           ^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/doc2dash/parsers/intersphinx.py", line 67, in detect
    with (path / "objects.inv").open("rb") as f:
          ~~~~~^~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'bytes' and 'str'
hynek commented 11 months ago

Can you give me more info on your environment including env variables and "pip freeze"? I've never heard of anything like that before.

VadeveSi commented 11 months ago

Hi hynek, thank you for the swift response! I figured it out: I had an older version of click (7.1.2) in my venv. I installed 8.1.6, and now it works again. Very weird.

Let me know if I can help with anything else regarding this problem. Otherwise, just close the issue.

hynek commented 11 months ago

I guess the solution is adding a lower pin to click then! :)