Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork965
Respectos.Pathlike#2086
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Respectos.Pathlike#2086
Conversation
36bd3ba to5d26325CompareGeorge-Ogden commentedNov 27, 2025
Also, I notice you skip mypy because it produces errors. Why not pin the version and increment it periodically? |
Byron commentedNov 28, 2025
That's a great incentive, thanks so much! Using
I don't see why this wouldn't work, great idea! Please feel free to set this up in your next PR :). |
Byron commentedNov 28, 2025
It seems that I won't get my copilot review here, so I wonder why you'd not be calling |
George-Ogden commentedNov 28, 2025
|
George-Ogden commentedNov 28, 2025
Sure thing |
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Byron left a comment
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.
This looks better indeed.
Something I think will be desirable is to actually add tests for non-decodable paths for the functions/types that are affected. Otherwise, how do we know it's working?
Feel free to use AI for that, it's quite good at this usually.
The idea is to prove that the changes actually make something possible that wasn't possible before.
| # When pathlib.Path or other class-based path is passed | ||
| ifnotisinstance(path,str): | ||
| path=str(path) | ||
| url=os.fspath(url) |
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.
URL is not a path though.
George-OgdenNov 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
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.
Here,url can be a path if you're cloning a local repo, and if it's notos.fspath will leave strings alone.
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.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
💡Add Copilot custom instructions for smarter, more guided reviews.Learn how to get started.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
db456d7 to57a3af1CompareGeorge-Ogden commentedNov 29, 2025
I've added a few tests, but lots of the calls work on internal APIs, so they won't make much difference. In these cases, calling |
Byron left a comment
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.
That's great, thanks a lot!
What should be shown in the tests is that it can now handle filepaths that don't decode with the standard encoding.
Candidate tests are:
- clone from a filesystem path
index.addwith a strange path- and probably more - you could intentionally break a piece of code that changed
fspathand see which tests fail, then it's clear where to add a test with a 'special' path.
Thanks for making this happen, and thanks for your understanding - we can't just make changes hoping it will work or doesn't make things work, but there must be real evidence that this is desirable. And we can only have that with tests that fail without this change.
Uh oh!
There was an error while loading.Please reload this page.
b45854a to15f985bCompare15f985b to8434967CompareByron commentedNov 30, 2025
I am putting the PR back to draft until there are tests that use the new "can handle paths encoding independently from the runtime encoding" to prove the changes are effective. Thanks again. |
George-Ogden commentedNov 30, 2025
Sorry, I meant to add this comment with the changes I made yesterday: For example, the |
Fixes#2085
Replaces instances of
str(path)withpath.__fspath__()for more general usage.I also moved the clone tests into a separate file that existed before but only contained a single test.