Skip to content

Commit

Permalink
close file handles of tempfile
Browse files Browse the repository at this point in the history
  • Loading branch information
singh-lokendra committed Jul 28, 2019
1 parent c8b1af2 commit 2a6db2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apertium/utils.py
Expand Up @@ -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
Expand Down

0 comments on commit 2a6db2e

Please sign in to comment.