1
Fork 0

Switched to spooled tmpfile

This commit is contained in:
Edgar P. Burkhart 2022-03-15 10:35:11 +01:00
parent 91c17ce00f
commit 03c691f41a
Signed by: edpibu
GPG Key ID: 9833D3C5A25BD227
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class ReadSwash:
@classmethod @classmethod
def read_nohead(cls, path): def read_nohead(cls, path):
with tempfile.TemporaryFile() as tmpfile: with tempfile.SpooledTemporaryFile() as tmpfile:
with open(path) as file: with open(path) as file:
subprocess.run(("tr", "-d", "\n"), stdin=file, stdout=tmpfile) subprocess.run(("tr", "-d", "\n"), stdin=file, stdout=tmpfile)
tmpfile.seek(0) tmpfile.seek(0)