From 8a2ed37006ae6ebc6a7dd08b5c4075c1646cde60 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2026 10:47:13 +0000 Subject: [PATCH] fix: resolve file paths correctly for file fixes --- codecov_cli/services/upload/upload_collector.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/codecov_cli/services/upload/upload_collector.py b/codecov_cli/services/upload/upload_collector.py index 22310e2f4..f46c5cfbf 100644 --- a/codecov_cli/services/upload/upload_collector.py +++ b/codecov_cli/services/upload/upload_collector.py @@ -109,13 +109,13 @@ def _produce_file_fixes( def _get_file_fixes( self, filename: str, fix_patterns_to_apply: fix_patterns_to_apply ) -> UploadCollectionResultFileFixer: - path = pathlib.Path(filename) + path = self.network_finder.network_root_folder / filename fixed_lines_without_reason = set() fixed_lines_with_reason = set() eof = None try: - with open(filename, "r", encoding="utf-8") as f: + with open(path, "r", encoding="utf-8") as f: # If lineno is unset that means that the # file is empty thus the eof should be 0 # so lineno will be set to -1 here @@ -143,6 +143,10 @@ def _get_file_fixes( reason=err.reason, ), ) + except FileNotFoundError: + logger.warning( + f"File not found: {filename}, file fixes were not applied to this file." + ) except IsADirectoryError: logger.info(f"Skipping {filename}, found a directory not a file")