-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 some Python2→3 error in publish_toolstate.py #82340
Conversation
(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
@bors r+ p=1 |
📌 Commit 8c0f2cdc0d4813850504f032cff40aadecd6e30e has been approved by |
This comment has been minimized.
This comment has been minimized.
8c0f2cd
to
45da227
Compare
@bors r+ |
📌 Commit 45da227 has been approved by |
⌛ Testing commit 45da227 with merge 052dc7b7cb8994871f32d350d5bb291c52b552c9... |
💔 Test failed - checks-actions |
@bors retry https://github.com/rust-lang-ci/rust/runs/1944667120
|
☀️ Test successful - checks-actions |
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).
Fix #82254.
The error is primarily due to
data = json.dumps(…)
producing astr
instead of abytes
, which are different types on Python 3. But thenurllib.request.urlopen(…, data)
cannot acceptdata
as 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 withmypy
on both Python 2 and 3.