Skip to content

Conversation

@emmatyping
Copy link
Member

This PR should fix the rest of the test failures in #19545.

A change to os.path.relpath in 3.13 seems to have broken the handling of Windows paths beginning with \\. To resolve this issue, we don't split the drive letter off of the path and instead verify the path is on the current drive. If it isn't it will never resolve to the package root because that must be on the same drive as the CWD:

mypy/mypy/main.py

Lines 1571 to 1572 in 5b03024

if drive and drive != current_drive:
parser.error(f"Package root must be on current drive: {drive + root!r}")

Keeping the drive letter allows relpath to properly generate a relative path and make the tests pass.

I need to investigate if the relpath change is a regression in CPython.

A change to relpath in 3.13 seems to have broken
the handling of paths beginning with `\\`.
@emmatyping emmatyping requested a review from ilevkivskyi August 4, 2025 03:51
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2025

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let me try this.

@ilevkivskyi ilevkivskyi merged commit 8f48f1b into python:master Aug 4, 2025
20 checks passed
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.

2 participants