Skip to content

fix: Make FileLock robust to the CWD (Fix #2252)#2261

Open
Prathmesh010190 wants to merge 1 commit into
microsoft:mainfrom
Prathmesh010190:fix-cwd-paths
Open

fix: Make FileLock robust to the CWD (Fix #2252)#2261
Prathmesh010190 wants to merge 1 commit into
microsoft:mainfrom
Prathmesh010190:fix-cwd-paths

Conversation

@Prathmesh010190

Copy link
Copy Markdown

Description

This PR fixes Issue #2252 by making FileLock path handling robust to the Current Working Directory (CWD).

The previous implementation used os.path.join, which could incorrectly anchor absolute paths to the current working directory in certain scenarios. This change replaces that logic with url2pathname, ensuring that absolute paths are handled correctly and consistently.

Motivation and Context

Fixes #2252.

This change prevents FileLock from incorrectly resolving lock file paths relative to the current working directory, improving reliability when working with absolute paths.

How Has This Been Tested?

  • Verified that the modified code correctly handles absolute paths.
  • Pass the test by running: pytest qlib/tests/test_all_pipeline.py
  • If you are adding a new feature, test on your own test scripts.

Screenshots of Test Results (if appropriate)

  1. Pipeline test: Not run.
  2. Your own tests: Verified path resolution behavior manually.

Types of changes

  • Fix bugs
  • Add new feature
  • Update documentation

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.

qlib.workflow: FileLock and _log_uncommitted_code both unsafe vs CWD

1 participant