All scripts/tests: always specify file encoding in calls to open() (#8882)

This commit is contained in:
Samuel T
2022-10-11 17:29:36 -04:00
committed by GitHub
parent 5ca2d77f85
commit 573ee94f35
9 changed files with 18 additions and 18 deletions

View File

@@ -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"]