Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Changelog

202x-xx-xx • `full history <https://github.com/gorakhargosh/watchdog/compare/v6.0.0...HEAD>`__

-
- Thanks to our beloved contributors: @BoboTiG, @
- Adjust ``Observer.schedule()`` ``path`` type annotation to reflect the ``pathlib.Path`` support. (`#1096 <https://github.com/gorakhargosh/watchdog/pull/1096>`__)
- Thanks to our beloved contributors: @BoboTiG, @tybug

6.0.0
~~~~~
Expand Down
4 changes: 2 additions & 2 deletions src/watchdog/observers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def start(self) -> None:
def schedule(
self,
event_handler: FileSystemEventHandler,
path: str,
path: str | Path,
*,
recursive: bool = False,
event_filter: list[type[FileSystemEvent]] | None = None,
Expand All @@ -301,7 +301,7 @@ def schedule(
:param path:
Directory path that will be monitored.
:type path:
``str``
``str`` or :class:`pathlib.Path`
:param recursive:
``True`` if events will be emitted for sub-directories
traversed recursively; ``False`` otherwise.
Expand Down
3 changes: 2 additions & 1 deletion src/watchdog/observers/fsevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import threading
import time
import unicodedata
from pathlib import Path
from typing import TYPE_CHECKING

import _watchdog_fsevents as _fsevents
Expand Down Expand Up @@ -326,7 +327,7 @@ def __init__(self, *, timeout: float = DEFAULT_OBSERVER_TIMEOUT) -> None:
def schedule(
self,
event_handler: FileSystemEventHandler,
path: str,
path: str | Path,
*,
recursive: bool = False,
follow_symlink: bool = False,
Expand Down
Loading