Skip to content

gh-108172: do not override OS preferred browser if it is a super-string of a known browser #113011

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
merged 4 commits into from
Aug 31, 2024

Conversation

guss77
Copy link
Contributor

@guss77 guss77 commented Dec 12, 2023

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_browsers will 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.

@ghost
Copy link

ghost commented Dec 12, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Dec 12, 2023

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 skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Dec 12, 2023

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 skip news label instead.

@guss77 guss77 force-pushed the patch-1 branch 4 times, most recently from 356b5f5 to e1872ff Compare December 13, 2023 15:58
guss77 and others added 2 commits January 4, 2024 09:29
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".
@guss77
Copy link
Contributor Author

guss77 commented May 4, 2024

Ping! Any chance someone can review this 1 line fix?

@gpshead gpshead merged commit 10bf615 into python:main Aug 31, 2024
36 checks passed
@gpshead gpshead added the needs backport to 3.13 bugs and security fixes label Aug 31, 2024
@miss-islington-app
Copy link

Thanks @guss77 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

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>
@bedevere-app
Copy link

bedevere-app bot commented Aug 31, 2024

GH-123527 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Aug 31, 2024
@gpshead gpshead added the needs backport to 3.12 only security fixes label Aug 31, 2024
@miss-islington-app
Copy link

Thanks @guss77 for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

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>
@bedevere-app
Copy link

bedevere-app bot commented Aug 31, 2024

GH-123528 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Aug 31, 2024
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>
@guss77 guss77 deleted the patch-1 branch August 31, 2024 09:41
@guss77
Copy link
Contributor Author

guss77 commented Aug 31, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants