Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7ec9d1

Browse files
committed
TST: open temporary file as text (not binary)
1 parent 6909ec5 commit c7ec9d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/tests/test_backend_nbagg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def _notebook_run(nb_file):
1313
"""Execute a notebook via nbconvert and collect output.
1414
:returns (parsed nb object, execution errors)
1515
"""
16-
with tempfile.NamedTemporaryFile(suffix=".ipynb") as fout:
16+
with tempfile.NamedTemporaryFile(suffix=".ipynb",
17+
mode='w+t') as fout:
1718
args = ["jupyter", "nbconvert", "--to", "notebook", "--execute",
1819
"--ExecutePreprocessor.timeout=500",
1920
"--output", fout.name, nb_file]

0 commit comments

Comments
 (0)