diff --git a/autosub/__init__.py b/autosub/__init__.py index 01c4bf9a..12cfdc11 100644 --- a/autosub/__init__.py +++ b/autosub/__init__.py @@ -71,7 +71,10 @@ def __call__(self, region): "-loglevel", "error", temp.name] use_shell = True if os.name == "nt" else False subprocess.check_output(command, stdin=open(os.devnull), shell=use_shell) - return temp.read() + read_data = temp.read() + temp.close() + os.unlink(temp.name) + return read_data except KeyboardInterrupt: return None