Skip to content

Commit

Permalink
Ticket #216: Write tempfiles in text mode (#223)
Browse files Browse the repository at this point in the history
When creating NamedTemporayFiles, open them in text mode
instead of default binary mode.
  • Loading branch information
degremont authored Jul 26, 2024
1 parent fe19f16 commit f1d95dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def makeTempFilename():

def makeTempFile(text):
""" Create a temporary file with the provided text."""
tmp = tempfile.NamedTemporaryFile(prefix='shine-test-')
tmp = tempfile.NamedTemporaryFile(prefix='shine-test-', mode='w')
tmp.write(text)
tmp.flush()
return tmp
Expand Down

0 comments on commit f1d95dc

Please sign in to comment.