Skip to content

watchdog: Prevent reload if a file gets closed without any changes #2945

@lociii

Description

@lociii

What's the issue?

watchdog 5.0 introduced a new signal that is fired when a file gets closed without any changes written.
This leads to random reloads when something opens and closes a file. opened events are already ignored, so we should ignore the new closed_no_write events too.

How to reproduce?

Update to watchdog 5.0+ and wait for the reloads to come in.

What's the expected behavior?

Werkzeug should only reload if there are actual changes to the code base.

Environment

  • Python version: 3.11.2
  • Werkzeug version: 3.0.4
  • watchdog version: 5.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions