From 4badd3532504bc48770e4ef0cfe38e57bc51dda5 Mon Sep 17 00:00:00 2001 From: "Michael J. Sullivan" Date: Tue, 23 Oct 2018 16:13:07 -0700 Subject: [PATCH] Allow json.dump to dump to BinaryIO again (#2546) PR #2516 aimed to widen the accepted file argument to json.dump, but since `IO` is invariant in its argument, it actually disallowed passing binary files. --- stdlib/2/json.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2/json.pyi b/stdlib/2/json.pyi index 62b917e9e..5b70217a1 100644 --- a/stdlib/2/json.pyi +++ b/stdlib/2/json.pyi @@ -20,7 +20,7 @@ def dumps(obj: Any, **kwds: Any) -> str: ... def dump(obj: Any, - fp: IO[Text], + fp: Union[IO[str], IO[Text]], skipkeys: bool = ..., ensure_ascii: bool = ..., check_circular: bool = ...,