Fix some Python2→3 error in publish_toolstate.py#82340
Merged
bors merged 1 commit intorust-lang:masterfrom Feb 21, 2021
Merged
Conversation
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
93c9086 to
8c0f2cd
Compare
Member
|
@bors r+ p=1 |
Collaborator
|
📌 Commit 8c0f2cdc0d4813850504f032cff40aadecd6e30e has been approved by |
This comment has been minimized.
This comment has been minimized.
8c0f2cd to
45da227
Compare
Member
|
@bors r+ |
Collaborator
|
📌 Commit 45da227 has been approved by |
Collaborator
|
⌛ Testing commit 45da227 with merge 052dc7b7cb8994871f32d350d5bb291c52b552c9... |
Collaborator
|
💔 Test failed - checks-actions |
Collaborator
Member
Author
|
@bors retry https://github.com/rust-lang-ci/rust/runs/1944667120 |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
rust-highfive
added a commit
to rust-lang-nursery/rust-toolstate
that referenced
this pull request
Feb 21, 2021
Tested on commit rust-lang/rust@ef14688. Direct link to PR: <rust-lang/rust#82340> 🎉 miri on windows: test-fail → test-pass (cc @oli-obk @eddyb @RalfJung). 🎉 miri on linux: test-fail → test-pass (cc @oli-obk @eddyb @RalfJung).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #82254.
The error is primarily due to
data = json.dumps(…)producing astrinstead of abytes, which are different types on Python 3. But thenurllib.request.urlopen(…, data)cannot acceptdataas astr, thus the error.This PR added
.encode()call afterjson.dumps()to ensure we are sendingbytes. Additionally, we added type annotation to ensure things can statically type-check withmypyon both Python 2 and 3.