From 8651e11d8f5ca3a111f68b819a90b13e7d1cc1a1 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sun, 9 Aug 2026 10:47:09 +0000 Subject: [PATCH] fix: resolve file paths correctly in _get_file_fixes --- codecov_cli/services/upload/upload_collector.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/codecov_cli/services/upload/upload_collector.py b/codecov_cli/services/upload/upload_collector.py index 22310e2f4..8ea52f2e7 100644 --- a/codecov_cli/services/upload/upload_collector.py +++ b/codecov_cli/services/upload/upload_collector.py @@ -109,13 +109,14 @@ def _produce_file_fixes( def _get_file_fixes( self, filename: str, fix_patterns_to_apply: fix_patterns_to_apply ) -> UploadCollectionResultFileFixer: - path = pathlib.Path(filename) + absolute_path = self.network_finder.network_root_folder / filename + path = pathlib.Path(absolute_path) fixed_lines_without_reason = set() fixed_lines_with_reason = set() eof = None try: - with open(filename, "r", encoding="utf-8") as f: + with open(absolute_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 +144,10 @@ def _get_file_fixes( reason=err.reason, ), ) + except FileNotFoundError: + logger.warning( + f"File not found: {absolute_path}, file fixes were not applied to this file." + ) except IsADirectoryError: logger.info(f"Skipping {filename}, found a directory not a file")