getnikola / nikola

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

nikola auto: "AttributeError: 'FileOpenedEvent' object has no attribute '_src_path'. Did you mean: 'src_path'?" #3761

Closed aknrdureegaesr closed 4 months ago

aknrdureegaesr commented 4 months ago

Environment

Python Version: 3.12.2

Nikola Version: SHA #b46b1211128 on my branch

Operating System: Debian Bullseye

Description:

nikola auto -b produces an error

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/python-3.12.2/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/home/andreas/workspace-famsik/dj3ei/venv/lib/python3.12/site-packages/watchdog/observers/api.py", line 223, in run
    self.dispatch_events(self.event_queue)
  File "/home/andreas/workspace-famsik/dj3ei/venv/lib/python3.12/site-packages/watchdog/observers/api.py", line 402, in dispatch_events
    handler.dispatch(event)
  File "/home/andreas/comp/nikola/nikola/plugins/command/auto/__init__.py", line 623, in dispatch
    if event._src_path == self.configuration_filename:
       ^^^^^^^^^^^^^^^
AttributeError: 'FileOpenedEvent' object has no attribute '_src_path'. Did you mean: 'src_path'?

Initial analysis:

Our dependency watchdog came out with a new major release 4.0.0 and 4.0.1. The private attribute _src_path has been promoted official to src_path.

Fix should be easy, forthcoming.