Skip to content

fix: resolve file paths correctly in _get_file_fixes - #758

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/cli-94-file-not-found
Open

fix: resolve file paths correctly in _get_file_fixes#758
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/cli-94-file-not-found

Conversation

@sentry

@sentry sentry Bot commented Aug 9, 2026

Copy link
Copy Markdown

This PR addresses a FileNotFoundError occurring in the _get_file_fixes function within upload_collector.py.

Problem:
The _get_file_fixes function attempted to open files using paths (filename) that were relative to the network_root_folder (as provided by git ls-files), but the open() call was implicitly resolving these paths relative to the current working directory. This led to FileNotFoundError when the current working directory differed from the network_root_folder, a common scenario in various CI environments. Additionally, there was no specific error handling for FileNotFoundError.

Solution:

  1. Corrected File Path Resolution: Modified the open() call to explicitly use the absolute path by prepending self.network_finder.network_root_folder to the filename.
  2. Updated Pathlib Object: Ensured the pathlib.Path object also uses the correctly resolved absolute path.
  3. Added FileNotFoundError Handling: Implemented an except FileNotFoundError block to gracefully handle cases where a file might still not be found (e.g., due to race conditions or external changes), logging a warning instead of crashing the upload process.

Fixes CLI-94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants