Repository navigation
Fix Windows drive-relative Path.resolve(strict=False) - #1353
Open
maqsudovelnur-creator wants to merge 1 commit into
Open
maqsudovelnur-creator wants to merge 1 commit into
maqsudovelnur-creator wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the changes
Fixes #1324.
On Windows, with the current directory set to
C:\test, resolvingc:test\test_data/dummy1.xmlwithstrict=Falsereturnedc:\est\test_data\dummy1.xmlinstead ofC:\test\test\test_data\dummy1.xml._join_real_pathtreated a drive prefix as an absolute root and discarded thefirst character of the relative component. For drive-relative paths on the
current drive, use the current directory, comparing drive letters without case
sensitivity, and retain the complete relative component. Preserve the existing
root handling for absolute paths and paths on another drive.
Add two regression tests to the existing pathlib test class, covering existing
and missing files, both drive-letter cases, and mixed separators. The inherited
real-filesystem variants also pass on native Windows. Add a release-note entry
under Unreleased / Fixes.
Validation
Windows, Python 3.13:
TEST_REAL_FS=1.The sole failure is the pre-existing
FakePathModuleTest::test_realpath_allow_missing, with the same failure message.No existing test gains a failure, skip, or xfail. Two new skips are the normally
disabled real-filesystem variants of the new tests.
new virtual environment before integrating these tests.
autoflake, and mypy hooks pass using Python 3.13 through a separate local
configuration; the tracked configuration is unchanged. Codespell could not
run due to Windows application control (
WinError 4551), so its result is pending.git diff --checkpasses.This change covers
strict=Falseas reported in #1324. A separate drive-relativevalidation problem with
strict=Trueis outside this fix. Other Python versionsand platforms remain for CI validation.
Tasks