Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
GH-85168: Use filesystem encoding when converting to/fromfile URIs#126852
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…` URIsAdjust `urllib.request.url2pathname()` and `pathname2url()` to use thefilesystem encoding when quoting and unquoting file URIs, rather thanforcing use of UTF-8.No changes are needed in the `nturl2path` module because Windows alwaysuses UTF-8, per PEP 529.
barneygale commentedNov 15, 2024 • 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.
Thefreedesktop file URI spec is a useful reference here:
Also:
|
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.
LGTM in general. But we should support URIs containing not quoted non-ASCII characters.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Thanks for the review - I've made the changes you suggested |
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.
LGTM.
You can also usefsdecode(TESTFN_UNDECODABLE) andTESTFN_UNENCODABLE in some tests if you wish.
c9b399f intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@barneygale for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…` URIs (pythonGH-126852)Adjust `urllib.request.url2pathname()` and `pathname2url()` to use thefilesystem encoding when quoting and unquoting file URIs, rather thanforcing use of UTF-8.No changes are needed in the `nturl2path` module because Windows alwaysuses UTF-8, per PEP 529.(cherry picked from commitc9b399f)Co-authored-by: Barney Gale <barney.gale@gmail.com>
…` URIs (pythonGH-126852)Adjust `urllib.request.url2pathname()` and `pathname2url()` to use thefilesystem encoding when quoting and unquoting file URIs, rather thanforcing use of UTF-8.No changes are needed in the `nturl2path` module because Windows alwaysuses UTF-8, per PEP 529.(cherry picked from commitc9b399f)Co-authored-by: Barney Gale <barney.gale@gmail.com>
GH-127039 is a backport of this pull request to the3.13 branch. |
GH-127040 is a backport of this pull request to the3.12 branch. |
…e` URIs (GH-126852) (#127040)GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852)Adjust `urllib.request.url2pathname()` and `pathname2url()` to use thefilesystem encoding when quoting and unquoting file URIs, rather thanforcing use of UTF-8.No changes are needed in the `nturl2path` module because Windows alwaysuses UTF-8, per PEP 529.(cherry picked from commitc9b399f)Co-authored-by: Barney Gale <barney.gale@gmail.com>
…e` URIs (GH-126852) (#127039)GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852)Adjust `urllib.request.url2pathname()` and `pathname2url()` to use thefilesystem encoding when quoting and unquoting file URIs, rather thanforcing use of UTF-8.No changes are needed in the `nturl2path` module because Windows alwaysuses UTF-8, per PEP 529.(cherry picked from commitc9b399f)Co-authored-by: Barney Gale <barney.gale@gmail.com>
…` URIs (python#126852)Adjust `urllib.request.url2pathname()` and `pathname2url()` to use thefilesystem encoding when quoting and unquoting file URIs, rather thanforcing use of UTF-8.No changes are needed in the `nturl2path` module because Windows alwaysuses UTF-8, per PEP 529.
Uh oh!
There was an error while loading.Please reload this page.
Adjust
urllib.request.url2pathname()andpathname2url()to use the filesystem encoding when quoting and unquoting file URIs, rather than forcing use of UTF-8.No changes are needed in the
nturl2pathmodule because Windows always uses UTF-8, per PEP 529.