]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #82340 - kennytm:fix-82254, r=Mark-Simulacrum
authorbors <bors@rust-lang.org>
Sun, 21 Feb 2021 09:42:50 +0000 (09:42 +0000)
committerbors <bors@rust-lang.org>
Sun, 21 Feb 2021 09:42:50 +0000 (09:42 +0000)
commitef1468822146032d53bc3970ef8382b72923e51f
treede62c233f776ad1da92990fd72638df1f1083b93
parented58a2b03b6284b070fae2349898b16df98b7765
parent45da2277a0e6452adc4e95baf57e62b01b27b429
Auto merge of #82340 - kennytm:fix-82254, r=Mark-Simulacrum

Fix some Python2→3 error in publish_toolstate.py

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.