-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
webbrowser._synthesize uses outdated calling signature for webbrowser.register #75197
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
Comments
The function |
Is it possible to write a test? |
What would a new test be testing? I only found this behaviour because two existing tests were failing (with the PR they pass, of course). I'm happy to write a test, I'm just not sure what the test should be testing that the existing tests don't already test. |
These tests are not failing on our buildbots and developer's computers. Seems they are failing only in special environment. This path of execution is not tested in more common environments, therefore possible regression couldn't be caught until somebody run tests in similar special environment. New test should test this path of execution in common environments. |
Ok I understand what you mean. I think the only conditions for test failure are (A) $BROWSER is set and (B) $BROWSER is set to an actual executable that should be caught by ``register_standard_browsers`` prior to execution reaching the last if clause of ``register_standard_browsers`` (``if 'BROWSER' in os.environ:``) - those two conditions should be sufficient for execution to reach the offending line of code. I'll see if I can cook up a test for that. I think the right way to do this is to monkeypatch |
This would be not easy. Since the BROWSER environment variable should be patched before the first use the webbrowser module, the test should import webbrowser in a separate process (you can use the test.support.script_helper.assert_python_ok() helper). _synthesize() is used in two places with different arguments: in register_standard_browsers() and in get(). |
I'm surprised that test_webbrowser pass on my Fedora 28, but it fails for Greg Walters: Some tests are skipped depending on the OS? Maybe we should mock more things, or something else, to get a better code coverage. I ran PR 2689 new test without the fix on webbrowser.py: the test doesn't fail. So this PR is not enough to detect bpo-33693. |
webbrowser._synthesize
callswebbrowser.register
with outdated signature #2689Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: