Skip to content

Commit

Permalink
Handle FileNotFoundError caused by processing new file in progressive…
Browse files Browse the repository at this point in the history
… mode
  • Loading branch information
kostyaplis committed Aug 30, 2022
1 parent f2d9471 commit 79619d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ansiblelint/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ def get(self, key: Any, default: Any = None) -> Any:

def _populate_content_cache_from_disk(self) -> None:
# Can raise UnicodeDecodeError
self._content = self.path.resolve().read_text(encoding="utf-8")
try:
self._content = self.path.resolve().read_text(encoding="utf-8")
except FileNotFoundError:
self._content = ""
if self._original_content is None:
self._original_content = self._content

Expand Down

0 comments on commit 79619d3

Please sign in to comment.