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.
@jgraham
jgraham approved these changes May 7, 2021
Copy link
Contributor

@jgraham jgraham left a comment

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 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
41 checks passed
41 checks passed
@github-actions
build-and-publish
Details
@github-actions
build-and-tag
Details
@azure-pipelines
Azure Pipelines Build #20210505.68 succeeded
Details
@azure-pipelines
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
@azure-pipelines
Azure Pipelines (affected tests without changes: Safari Technology Preview) affected tests without changes: Safari Technology Preview succeeded
Details
@azure-pipelines
Azure Pipelines (affected tests: Safari Technology Preview) affected tests: Safari Technology Preview succeeded
Details
@azure-pipelines
Azure Pipelines (infrastructure/ tests: macOS) infrastructure/ tests: macOS succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: Windows + Python 3.6) tools/ unittests: Windows + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: Windows + Python 3.9) tools/ unittests: Windows + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: macOS + Python 3.6) tools/ unittests: macOS + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/ unittests: macOS + Python 3.9) tools/ unittests: macOS + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: Windows + Python 3.6) tools/wpt/ tests: Windows + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: Windows + Python 3.9) tools/wpt/ tests: Windows + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: macOS + Python 3.6) tools/wpt/ tests: macOS + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wpt/ tests: macOS + Python 3.9) tools/wpt/ tests: macOS + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: Windows + Python 3.6) tools/wptrunner/ unittests: Windows + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: Windows + Python 3.9) tools/wptrunner/ unittests: Windows + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: macOS + Python 3.6) tools/wptrunner/ unittests: macOS + Python 3.6 succeeded
Details
@azure-pipelines
Azure Pipelines (tools/wptrunner/ unittests: macOS + Python 3.9) tools/wptrunner/ unittests: macOS + Python 3.9 succeeded
Details
@azure-pipelines
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests) wpt.fyi hook: safari-preview-affected-tests succeeded
Details
@azure-pipelines
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes) wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
@community-tc-integration
download-firefox-nightly Community-TC (pull_request)
Details
@community-tc-integration
infrastructure/ tests Community-TC (pull_request)
Details
@community-tc-integration
lint Community-TC (pull_request)
Details
@community-tc-integration
resources/ tests (Python 3.6) Community-TC (pull_request)
Details
@community-tc-integration
resources/ tests (Python 3.9) Community-TC (pull_request)
Details
@community-tc-integration
sink-task Community-TC (pull_request)
Details
@community-tc-integration
tools/ integration tests (Python 3.6) Community-TC (pull_request)
Details
@community-tc-integration
tools/ integration tests (Python 3.9) Community-TC (pull_request)
Details
@community-tc-integration
tools/ unittests (Python 3.6) Community-TC (pull_request)
Details
@community-tc-integration
tools/ unittests (Python 3.9) Community-TC (pull_request)
Details
@community-tc-integration
wpt-chrome-dev-results Community-TC (pull_request)
Details
@community-tc-integration
wpt-chrome-dev-results-without-changes Community-TC (pull_request)
Details
@community-tc-integration
wpt-chrome-dev-stability Community-TC (pull_request)
Details
@community-tc-integration
wpt-decision-task Community-TC (pull_request)
Details
@community-tc-integration
wpt-firefox-nightly-results Community-TC (pull_request)
Details
@community-tc-integration
wpt-firefox-nightly-results-without-changes Community-TC (pull_request)
Details
@community-tc-integration
wpt-firefox-nightly-stability Community-TC (pull_request)
Details
@wpt-fyi
wpt.fyi - chrome[experimental] Chrome results
Details
@wpt-fyi
wpt.fyi - firefox[experimental] Firefox results
Details
@wpt-fyi
wpt.fyi - safari[experimental] Safari results
Details
@foolip foolip deleted the foolip/firefox_env_var_bytes branch May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants