gh-108172: do not override OS preferred browser if it is a super-string of a known browser#113011
Merged
gpshead merged 4 commits intopython:mainfrom Aug 31, 2024
Merged
gh-108172: do not override OS preferred browser if it is a super-string of a known browser#113011gpshead merged 4 commits intopython:mainfrom
gpshead merged 4 commits intopython:mainfrom
Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
2 tasks
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
356b5f5 to
e1872ff
Compare
When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox".
Contributor
Author
|
Ping! Any chance someone can review this 1 line fix? |
gpshead
approved these changes
Aug 31, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Aug 31, 2024
…r-string of a known browser (pythonGH-113011) When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox". python#108172 explains in more detail, and lays out a potential better future enhancement for this case of just using xdg-open. We'll go with this for now. --------- (cherry picked from commit 10bf615) Co-authored-by: Oded Arbel <oded@geek.co.il> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-123527 is a backport of this pull request to the 3.13 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Aug 31, 2024
…r-string of a known browser (pythonGH-113011) When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox". python#108172 explains in more detail, and lays out a potential better future enhancement for this case of just using xdg-open. We'll go with this for now. --------- (cherry picked from commit 10bf615) Co-authored-by: Oded Arbel <oded@geek.co.il> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
GH-123528 is a backport of this pull request to the 3.12 branch. |
gpshead
pushed a commit
that referenced
this pull request
Aug 31, 2024
…er-string of a known browser (GH-113011) (GH-123528) gh-108172: do not override OS preferred browser if it is a super-string of a known browser (GH-113011) When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox". #108172 explains in more detail, and lays out a potential better future enhancement for this case of just using xdg-open. We'll go with this for now. --------- (cherry picked from commit 10bf615) Co-authored-by: Oded Arbel <oded@geek.co.il> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Contributor
Author
|
Thanks for the backport! (I'm running 3.12 and this will be mighty useful to me). |
Yhg1s
pushed a commit
that referenced
this pull request
Sep 2, 2024
…er-string of a known browser (GH-113011) (#123527) gh-108172: do not override OS preferred browser if it is a super-string of a known browser (GH-113011) When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox". #108172 explains in more detail, and lays out a potential better future enhancement for this case of just using xdg-open. We'll go with this for now. --------- (cherry picked from commit 10bf615) Co-authored-by: Oded Arbel <oded@geek.co.il> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As discussed in issue #108172 , if one of the known browser is a substring match to the OS preferred browser (for example, if the preferred browser is
firefox-nightly.desktop),register_X_browserswill override the preferred browser with the wrong browser.The (more) correct way to see if the preferred browser is being registered is to compare its name to the expected FDo desktop entry name. This isn't very accurate, the linked issue details a possibly better idea, but this one works.
xdg-settings get default-web-browserresult #108172