Skip to content
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

Fix setting os.environ["PATH"] to a binary string #28849

Merged
merged 1 commit into from May 7, 2021

Conversation

foolip
Copy link
Member

@foolip foolip commented May 5, 2021

This code would raise "TypeError: str expected, not bytes" is run using
Python 3, since setting os.environ keys implictly encodes using
sys.getfilesystemencoding():
https://docs.python.org/3/library/os.html#os.environ

This might be dead code, or simply not exercised in wpt's CI.

Spotted while preparing #28848.

This code would raise "TypeError: str expected, not bytes" is run using
Python 3, since setting os.environ keys implictly encodes using
sys.getfilesystemencoding():
https://docs.python.org/3/library/os.html#os.environ

This might be dead code, or simply not exercised in wpt's CI.

Spotted while preparing #28848.
@wpt-pr-bot wpt-pr-bot added infra wptrunner The automated test runner, commonly called through ./wpt run labels May 5, 2021
@foolip foolip assigned jgraham and unassigned LukeZielinski May 5, 2021
Copy link
Contributor

@jgraham jgraham left a comment

Choose a reason for hiding this comment

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

I assume if this fails it will fail on Gecko CI, but it looks right so I'll take the risk :)

@foolip
Copy link
Member Author

foolip commented May 7, 2021

@jgraham I'm going to guess that this code doesn't run on Gecko CI either, unless maybe it's running as Python 2. Run as Python 3 it should throw an error...

Let me know and revert quickly if this break Gecko :)

@foolip foolip merged commit 3d2cc99 into master May 7, 2021
@foolip foolip deleted the foolip/firefox_env_var_bytes branch May 7, 2021 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra wptrunner The automated test runner, commonly called through ./wpt run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants