Fix Windows path handling on Python 3.13+ by Byron · Pull Request #2196 · gitpython-developers/GitPython
Tasks refackiew unwrinkle Summary make index and submodule path normalization distinguish drive-rooted, drive-relative, UNC, and device paths on Windows confine normalized paths with commonpath instead of string-prefix checks normalize includeIf gitdir patterns to Git-style separators cover the other isabs consumers whose drive-rooted behavior correctly relies on Windows join semantics remove the Windows 3.13-3.15 CI exclusions and add 3.13-3.15 to tox make the pre-existing tests independent of a local master branch and linked-worktree-specific alternates This addresses the remaining Windows path checklist from #1955 and closes #2072. For context, the classifiers mentioned in the issue were introduced by 904aa71 (Declare support for Python 3.13-3.14) and 7d5370d (Add support for Python 3.15), both included in 3.1.56. This PR supplies the Windows path work that those metadata changes did not include. Windows path coverage paths absolute on the current drive drive-rooted paths such as \directory and /directory drive-relative paths such as C:directory (rejected where repository confinement is required) other-drive, UNC, and device paths traversal and adjacent-prefix escape attempts native and Git-style separators in conditional includes config includes, submodule gitfiles, linked worktree metadata, clone destinations, and Cygwin-path conversion Validation Python 3.12.13, 3.13.14, 3.14.6, 3.14.6t, 3.15.0b4, and 3.15.0b4t installed locally with uv full test set passed for every interpreter in an independent clone without a local master branch; daemon-free suites ran in parallel and test_remote.py ran serially because its fixed local daemon endpoint cannot be shared across processes Ruff check and format mypy basedpyright all pre-commit hooks
Skip to content