mar10/wsgidav

ValueError: Invalid dir_browser htdocs_path

ciupicri opened this issue · 17 comments

Describe the bug

wsgidav fails to start with the default configuration, probably because pip install does not install everything that's required.

To Reproduce

  1. Install it by running
pip3 install --user --use-feature=in-tree-build --compile --no-binary ":all" .
  1. Run
wsgidav --root=/usr/share/empty

Expected behavior

It should start.

Screenshots, Log-Files, Stacktrace

Running without configuration file.
Traceback (most recent call last):
  File "/home/ciupicri/.local/bin/wsgidav", line 8, in <module>
    sys.exit(run())
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/server/server_cli.py", line 803, in run
    app = WsgiDAVApp(config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/wsgidav_app.py", line 237, in __init__
    app = mw(self, self.application, config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/_dir_browser.py", line 60, in __init__
    raise ValueError(
ValueError: Invalid dir_browser htdocs_path '/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/htdocs'

Environment

WsgiDAV/4.0.1 Python/3.10.2(64 bit) Linux-5.15.15-200.fc35.x86_64-x86_64-with-glibc2.34
Python from: /usr/bin/python3
mar10 commented

This worked for me:

cd test_pip
test_pip % python -m venv .venv
test_pip % source .venv/bin/activate
test_pip % python -m pip install -U pip 
test_pip % python -m pip install wsgidav cheroot
test_pip % wsgidav --root . --auth anonymous --browse

It works for me too, but you should also try it with the bleeding edge version, i.e. d22ada5.

Also in case it matters,

$ pip3 --version
pip 21.2.3 from /usr/lib/python3.10/site-packages/pip (python 3.10)

The issue is simple: the htdocs_path folder is not included in the .tar.gz archive uploaded to PyPI.

It doesn't even get installed when running python setup.py install in the root of this repo. The folder is only correctly installed when using the wheel published to PyPI.

mar10 commented

setup.py sdist worked for me on macOS, but for some reason not on the Windows box I use to build (because of the MSI istaller).
Adding it to options.data_files now, hope it doesn't break anything

I've updated to c83c2bd and reinstalled, but I'm still getting

Running without configuration file.
Traceback (most recent call last):
  File "/home/ciupicri/.local/bin/wsgidav", line 8, in <module>
    sys.exit(run())
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/server/server_cli.py", line 803, in run
    app = WsgiDAVApp(config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/wsgidav_app.py", line 237, in __init__
    app = mw(self, self.application, config)
  File "/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/_dir_browser.py", line 60, in __init__
    raise ValueError(
ValueError: Invalid dir_browser htdocs_path '/home/ciupicri/.local/lib/python3.10/site-packages/wsgidav/dir_browser/htdocs'

For what's worth, I am seeing the same issue on a Raspberry Pi. Is there a work-around?

Yeah, create a symlink where it's needed pointing to that directory in the source code, e.g.
~/.local/lib/python3.10/site-packages/wsgidav/dir_browser/htdocs ->
~/github-repos/wsgidav/wsgidav/dir_browser/htdocs

Or just copy the whole thing.

Thanks, Cristian!

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
Thank you for your contributions.

I've just tested version c6b4fd7 and the issue is still present.

I've just tested version 6c04339 and the issue is still present.

mar10 commented

Can you give it another try?

Version 721d85c works fine.

mar10 commented

Thanks

I have the same problem.
Please excuse my ignorance (I have no clue about git, pip etc): how can I use install this version? Thx.

sry, found it myself.
https://wsgidav.readthedocs.io/en/latest/installation.html#linux-macos

Or install the latest (potentially unstable) development version directly from GitHub:
$ pip install git+https://github.com/mar10/wsgidav.git