From f38a90560bcbb650a6b5952d0ef1cafe73201c7c Mon Sep 17 00:00:00 2001 From: Red S Date: Tue, 4 Jul 2023 23:22:38 -0700 Subject: [PATCH] fix: ignore xls spurious warning #70 - ignore WARNING *** file size (92598) not 512 + multiple of sector size (512) --- beancount_reds_importers/libreader/xlsreader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beancount_reds_importers/libreader/xlsreader.py b/beancount_reds_importers/libreader/xlsreader.py index 49e8ac7..e2077a3 100644 --- a/beancount_reds_importers/libreader/xlsreader.py +++ b/beancount_reds_importers/libreader/xlsreader.py @@ -4,6 +4,7 @@ import petl as etl import re from beancount_reds_importers.libreader import csvreader +from os import devnull class Importer(csvreader.Importer): @@ -31,4 +32,5 @@ def initialize_reader(self, file): self.reader_ready = True def read_raw(self, file): - return etl.fromxls(file.name) + # set logfile to ignore WARNING *** file size (92598) not 512 + multiple of sector size (512) + return etl.fromxls(file.name, logfile=open(devnull, 'w'))