From f32cebf83d14f8557f4b4b5c3ac6ac0ad5acb21b Mon Sep 17 00:00:00 2001 From: vapniks Date: Thu, 30 May 2019 17:25:29 +0100 Subject: [PATCH] Don't try to truncate sys.stdout --- icsv2ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icsv2ledger.py b/icsv2ledger.py index de4c6fb..c752748 100755 --- a/icsv2ledger.py +++ b/icsv2ledger.py @@ -945,7 +945,7 @@ def process_input_output(in_file, out_file): Process them. Write Ledger lines either to filename or stdout. """ - if not options.incremental: + if not options.incremental and not out_file == sys.stdout: out_file.truncate(0) csv_lines = get_csv_lines(in_file)