From e4912a8d4d97fce72e64e8af8e59b674a38d49f2 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 7 Mar 2011 23:22:53 -0400 Subject: [PATCH] Close file descriptors to prevent memory leaks --- apps/ocr/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ocr/api.py b/apps/ocr/api.py index 86338de21f..e19217cc5a 100644 --- a/apps/ocr/api.py +++ b/apps/ocr/api.py @@ -35,7 +35,7 @@ def run_tesseract(input_filename, output_filename_base, lang=None): if lang is not None: command += ['-l', lang] - proc = subprocess.Popen(command, stderr=subprocess.PIPE, stdout=subprocess.PIPE) + proc = subprocess.Popen(command, close_fds=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE) return_code = proc.wait() if return_code != 0: error_text = proc.stderr.read()