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

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

Merged
merged 1 commit into from
May 22, 2024

Conversation

evgeni
Copy link
Contributor

@evgeni evgeni commented May 22, 2024

Pull Request Checklist

  • I’ve read the guidelines for contributing.
  • I updated AUTHORS.txt and CHANGES.txt (if the change is non-trivial) and documentation (if applicable).
  • I tested my changes.

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
Copy link
Contributor Author

evgeni commented May 22, 2024

See gorakhargosh/watchdog@41fca1e for the change in watchdog

@evgeni
Copy link
Contributor Author

evgeni commented May 22, 2024

Fixes #3766, I guess

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
@Kwpolska Kwpolska merged commit f7989de into getnikola:master May 22, 2024
11 checks passed
@Kwpolska
Copy link
Member

Thanks for contributing!

@evgeni evgeni deleted the watchdog4-events branch May 22, 2024 20:56
@evgeni evgeni mentioned this pull request May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants