From 7dfe7a80f7ff2f7ceb8d4c51621155fd36b60bfc Mon Sep 17 00:00:00 2001 From: Zach Nation Date: Wed, 22 Aug 2018 11:35:22 -0700 Subject: [PATCH] Fix test_json failure in Python 3 (#1024) Make sure we open a NamedTemporaryFile in a way that allows writing strings (not just bytes). In Python 3, string literals are unicode. --- src/unity/python/turicreate/test/test_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unity/python/turicreate/test/test_json.py b/src/unity/python/turicreate/test/test_json.py index 5410d98e09..f50c08ccc5 100644 --- a/src/unity/python/turicreate/test/test_json.py +++ b/src/unity/python/turicreate/test/test_json.py @@ -276,7 +276,7 @@ def test_malformed_json(self): } ] """ - with tempfile.NamedTemporaryFile() as f: + with tempfile.NamedTemporaryFile('w') as f: f.write(out) f.flush()