Skip to content

Commit

Permalink
fix(File): fix secure write when opening in binary mode
Browse files Browse the repository at this point in the history
  • Loading branch information
andresailer committed Apr 18, 2024
1 parent e39e36f commit 093575e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DIRAC/Core/Utilities/File.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def secureOpenForWrite(filename=None, *, text=True):
)
else:
fd, filename = tempfile.mkstemp(text=text)
with open(fd, "w" if text else "wb", encoding="ascii") as fd:
with open(fd, "w" if text else "wb", encoding="ascii" if text else None) as fd:
yield fd, filename


Expand Down

0 comments on commit 093575e

Please sign in to comment.