mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-27 22:31:12 +08:00
All scripts/tests: always specify file encoding in calls to open() (#8882)
This commit is contained in:
@@ -44,8 +44,8 @@ requests.post("http://httpbin.org/anything", data=b"foobar").json()["data"]
|
||||
requests.post("http://httpbin.org/anything", data="foobar").json()["data"]
|
||||
|
||||
# Files
|
||||
requests.post("http://httpbin.org/anything", data=open("/tmp/foobar", "rb")).json()["data"]
|
||||
requests.post("http://httpbin.org/anything", data=open("/tmp/foobar", "r")).json()["data"]
|
||||
requests.post("http://httpbin.org/anything", data=open("/tmp/foobar", "rb", encoding="UTF-8")).json()["data"]
|
||||
requests.post("http://httpbin.org/anything", data=open("/tmp/foobar", "r", encoding="UTF-8")).json()["data"]
|
||||
|
||||
# Mappings
|
||||
requests.post("http://httpbin.org/anything", data={b"foo": b"bar"}).json()["form"]
|
||||
|
||||
Reference in New Issue
Block a user