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 some Python2→3 error in publish_toolstate.py #82340

Merged
merged 1 commit into from
Feb 21, 2021

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Feb 20, 2021

Fix #82254.

The error is primarily due to data = json.dumps(…) producing a str instead of a bytes, which are different types on Python 3. But then urllib.request.urlopen(…, data) cannot accept data as a str, thus the error.

This PR added .encode() call after json.dumps() to ensure we are sending bytes. Additionally, we added type annotation to ensure things can statically type-check with mypy on both Python 2 and 3.

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 20, 2021
@rust-log-analyzer

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Feb 20, 2021

📌 Commit 8c0f2cdc0d4813850504f032cff40aadecd6e30e has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 20, 2021
@rust-log-analyzer

This comment has been minimized.

@camelid camelid added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Feb 20, 2021
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 21, 2021

📌 Commit 45da227 has been approved by Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Feb 21, 2021

⌛ Testing commit 45da227 with merge 052dc7b7cb8994871f32d350d5bb291c52b552c9...

@bors
Copy link
Contributor

bors commented Feb 21, 2021

💔 Test failed - checks-actions

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 21, 2021
@kennytm
Copy link
Member Author

kennytm commented Feb 21, 2021

@bors retry

https://github.com/rust-lang-ci/rust/runs/1944667120

2021-02-21T04:36:47.5316965Z ##[section]Starting: Request a runner to run this job
2021-02-21T04:36:50.7939919Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'macos-latest'
2021-02-21T04:36:50.8340559Z Can't find any online and idle self-hosted runner in current repository's organization account that matches the required labels: 'macos-latest'
2021-02-21T04:36:50.9786164Z Found online and idle hosted runner in current repository's organization account that matches the required labels: 'macos-latest'
2021-02-21T04:36:51.2426771Z ##[section]Finishing: Request a runner to run this job

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 21, 2021
@bors
Copy link
Contributor

bors commented Feb 21, 2021

⌛ Testing commit 45da227 with merge ef14688...

@bors
Copy link
Contributor

bors commented Feb 21, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing ef14688 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 21, 2021
@bors bors merged commit ef14688 into rust-lang:master Feb 21, 2021
@rustbot rustbot added this to the 1.52.0 milestone Feb 21, 2021
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #82340!

Tested on commit ef14688.
Direct link to PR: #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).

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).
@kennytm kennytm deleted the fix-82254 branch February 21, 2021 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

toolstate repository not updated
7 participants