Skip to content

Conversation

@yukim
Copy link
Contributor

@yukim yukim commented Feb 16, 2020

No description provided.

# >>> webbrowser._browser
#
if len(webbrowser._tryorder) == 0:
if webbrowser._tryorder is None or len(webbrowser._tryorder) == 0:
Copy link
Member

Choose a reason for hiding this comment

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

Can you just call webbrowser.get() and leave the rest of the code as-is? This will initialize the _tryorder variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

in a Docker testing environment it's likely that no default browser is installed and so you could end up in https://github.com/python/cpython/blob/3.7/Lib/webbrowser.py#L65, so I'm +1 with the fix here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried webbroser.get() and ran in docker container, and I hit the error mentioned. So I think it is safer to check if it is None.

@jeffwidman
Copy link
Contributor

Is this still relevant? Looks like the relevant code on trunk is a bit different than when this PR was opened...

If no longer relevant, can you please close this?

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.

5 participants