| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…fault Follow-up to 0879ebc. Add *resolve_netloc* keyword-only argument to `url2pathname()`, defaulting to false. When set to true, we call `socket.gethostbyname()` to resolve the URL authority (netloc).
| if authority == hostname: | ||
| return True | ||
| # Compare IP addresses | ||
| if not resolve: |
There was a problem hiding this comment.
I wonder, should we check this before calling gethostname() which can fail?
Sorry, something went wrong.
There was a problem hiding this comment.
I'm struggling to come up with firm info on when gethostname() fails (or whether it can perform network access). Do you have any pointers? Thanks.
Sorry, something went wrong.
There was a problem hiding this comment.
I do not know.
But I was thinking about this case: processing the "file:" URL on different computer. We cannot use gethostname(), because it returns a different result. If we want to get a path on other computer, we should ignore the host name. There will still be problem with processing Windows paths on Posix and Posix paths on Windows.
I do not know how common this case, and how common the opposite case, when we only use gethostname(), but not gethostbyname(). We should guess what would be more useful for users without having any data.
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
Thanks for the reviews - sorry for my slow response |
Sorry, something went wrong.
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
@serhiy-storchaka sorry for the short notice, but would you mind if I merge this in time for 3.14 beta 1? I can log your outstanding feedback as a follow-up issue; I suspect we can address it during the 3.14 beta period without affecting the API. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
I do not actually know what to do when we want to parse the "file:" URL on different machine, especially if they are Windows and Posix. On Windows, we can always interpret the host name as a UNC path. On Posix we can only ignore it or raise an exception if it is not localhost.
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @barneygale for commit 2a42d88 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132610%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
…fault (python#132610) Follow-up to 66cdb2b. Add *resolve_host* keyword-only argument to `url2pathname()`, defaulting to false. When set to true, we call `socket.gethostbyname()` to resolve the URL hostname. Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
| Back | FazBrowse Home | New Git URL |
Follow-up to 66cdb2b.
Add resolve_host keyword-only argument to url2pathname(), defaulting to false. When set to true, we call socket.gethostbyname() to resolve the URL authority (netloc).