getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.6k stars 448 forks source link

properly support watchdog 4+ where events always have dest_path #3775

Closed evgeni closed 4 months ago

evgeni commented 4 months ago

Pull Request Checklist

Description

Since watchdog 4 all events have the dest_path property, but that property can be empty, thus breaking nikola auto:

ERROR: asyncio: Task exception was never retrieved
future: <Task finished name='Task-57' coro=<CommandAuto.reload_page() done, defined at nikola/plugins/command/auto/__init__.py:427> exception=ValueError('no path specified')>
Traceback (most recent call last):
  File "nikola/plugins/command/auto/__init__.py", line 440, in reload_page
    p = os.path.relpath(event_path, os.path.abspath(self.site.config['OUTPUT_FOLDER'])).replace(os.sep, '/')
  File "/usr/lib64/python3.8/posixpath.py", line 453, in relpath
    raise ValueError("no path specified")
ValueError: no path specified
evgeni commented 4 months ago

See https://github.com/gorakhargosh/watchdog/commit/41fca1eb601139922817a17b6335a8c2d2c8db51 for the change in watchdog

evgeni commented 4 months ago

Fixes https://github.com/getnikola/nikola/issues/3766, I guess

Kwpolska commented 4 months ago

Thanks for contributing!