Skip to content

Conversation

@zmwangx
Copy link
Contributor

@zmwangx zmwangx commented Nov 24, 2018

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default value for preferred should be negated as well. And perhaps tests need to be updated.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.7 labels Nov 24, 2018
@zmwangx
Copy link
Contributor Author

zmwangx commented Nov 24, 2018

@serhiy-storchaka Thanks for the quick review. Actually, register is called 28 times in webbrowser.py, mostly with an implicit preferred=False, so changing the default value will be quite impactful. Of course, it is arguable that a default value of True may be more intuitive when exposed in the public API, but here comes another problem: since webbrowser.register is public API, is changing the default value of a kwarg allowed in a patch release? Or should I not worry about backporting and let committers figure out that part?

I'll look into adding/updating tests a bit later.

@serhiy-storchaka
Copy link
Member

I meant the default value in _synthesize().

@zmwangx
Copy link
Contributor Author

zmwangx commented Nov 24, 2018

Oh okay that makes more sense.

@zmwangx
Copy link
Contributor Author

zmwangx commented Nov 24, 2018

Wait, are you saying the default value in _synthesize() should be False? Since _synthesize() appears to only be used in situations where the browser is user-supplied, default False seems counterintuitive.

@serhiy-storchaka
Copy link
Member

Before e3ce695 both register() and _synthesize() had an undocumented parameter update_tryorder with the default value 1 which meant "add as least preferred". In e3ce695 update_tryorder=1 in register() was replaced with preferred=False, and in 25b804a update_tryorder=1 in _synthesize() was incorrectly replaced with preferred=True. It is my mistake.

@zmwangx zmwangx force-pushed the bpo-35308-webbrowser-respect-BROWSER branch from 03cf2e4 to 903a26d Compare November 26, 2018 16:10
@zmwangx
Copy link
Contributor Author

zmwangx commented Nov 26, 2018

Sorry for the delay here. Default value of preferred to _synthesize() has been flipped, and a test has been added to make sure BROWSER always takes precedence.

To bot: I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@serhiy-storchaka: please review the changes made to this pull request.

Regression introduced in e3ce695 and 25b804a, where the old parameter
update_tryorder to _synthesize was first ignored, then given the opposite
value in the attempt to fix bpo-31014.
@zmwangx zmwangx force-pushed the bpo-35308-webbrowser-respect-BROWSER branch from 903a26d to 82b841f Compare November 26, 2018 16:20
@miss-islington
Copy link
Contributor

Thanks @zmwangx for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 26, 2018
…thonGH-10693)

Regression introduced in e3ce695 and 25b804a, where the old parameter
update_tryorder to _synthesize was first ignored, then given the opposite
value in the attempt to fix bpo-31014.
(cherry picked from commit 8c281ed)

Co-authored-by: Zhiming Wang <[email protected]>
@bedevere-bot
Copy link

GH-10729 is a backport of this pull request to the 3.7 branch.

@zmwangx zmwangx deleted the bpo-35308-webbrowser-respect-BROWSER branch November 26, 2018 21:35
miss-islington added a commit that referenced this pull request Nov 26, 2018
…-10693)

Regression introduced in e3ce695 and 25b804a, where the old parameter
update_tryorder to _synthesize was first ignored, then given the opposite
value in the attempt to fix bpo-31014.
(cherry picked from commit 8c281ed)

Co-authored-by: Zhiming Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants