commit 2a6db2efcf401cc18065d42fd5c0ebcefb323c0c Author: vaydheesh Date: Sun Jul 28 19:26:40 2019 +0530 close file handles of tempfile diff --git a/apertium/utils.py b/apertium/utils.py index 8fe0921..dd0d411 100644 --- a/apertium/utils.py +++ b/apertium/utils.py @@ -53,6 +53,9 @@ def execute_pipeline(inp: str, commands: List[List[str]]) -> str: if wrappers_available: input_file = tempfile.NamedTemporaryFile(delete=False) output_file = tempfile.NamedTemporaryFile(delete=False) + # file handles are opened by default, and needs to be closed to use on windows + input_file.close() + output_file.close() arg = command[1][1] if len(command) >= 3 else '' path = command[-1] input_file_name, output_file_name = input_file.name, output_file.name