-
-
Notifications
You must be signed in to change notification settings - Fork 983
Add support for Python 3.15 #2183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+15
−6
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EliahKagan I wonder if this comment is still valid? We have been running on Windows for a while, even though maybe not with all tests enabled.
My hope would be that with the improvements to deterministic destruction, more tests can work as filehandles will be closed more reliably.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The semantics of
os.path.isabschanged in Python 3.13 on Windows. This had caused the behavior of code likeindex.remove('/only/looks/absolute')to differ, such that it was not immediately obvious what the behavior should be. It caused a test to fail, but that could not reasonably be fixed without figuring out what ought to actually happen.I think it's very likely that GitPython has or had bugs that would make this behavior wrong both before and after the chage, though I am not sure. Really, all uses of
os.path.isabs, including when spelling itosp.isabsafterimport os.path as osp, should be audited, and also compared to the uses of theis_absolutemethod ofPath, which I believe had always regarded paths beginning with a single separator as non-absolute on Windows.I had meant to fix this in #1955 but that ended up stalling due to my inability to put much time into GitPython at the time, and I very much agree with its closure--I should've myself closed it much earlier, to make clearer to others that they should feel welcome to contribute tests and fixes.
To be clear, paths on Windows that start with a single
/or\are indeed not absolute, because they are relative to the current drive. (A path that starts with a single/on a Unix-like system is of course absolute.) However, it may be that existing code in GitPython also assumes that, even on Windows, all relative paths are relative to a specific directory, rather than unconditionally specifying a root directory but relative to the current drive. So the way GitPython handles relative and absolute paths in general, including but not limited to when it usesos.path.isabsorpathlib.Path.is_absoluteor related functions, should be examined in case there are bugs.I suspect that, these days, all of this can be examined, and any findings rechecked and remediated, fairly efficiently.