From 6cc5135d2d7100684b4d3741b7be0927c7698159 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 19 Jan 2017 16:41:10 -0800 Subject: [PATCH] Output to stdout: ensure stdout is flushed to prevent truncation errors --- ocrmypdf/pipeline.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ocrmypdf/pipeline.py b/ocrmypdf/pipeline.py index 97e84e5f..f372d32d 100644 --- a/ocrmypdf/pipeline.py +++ b/ocrmypdf/pipeline.py @@ -806,6 +806,7 @@ def copy_final( from shutil import copyfileobj with open(input_file, 'rb') as input_stream: copyfileobj(input_stream, sys.stdout.buffer) + sys.stdout.flush() else: shutil.copy(input_file, output_file)