From 1a823c3e3d55159e593b7677142ef467de28c47f Mon Sep 17 00:00:00 2001 From: sanqui Date: Wed, 31 Aug 2016 18:36:37 +0000 Subject: [PATCH] Fix lists when encountering inacessible entries --- bin/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/core.py b/bin/core.py index 8387fee..92365cf 100644 --- a/bin/core.py +++ b/bin/core.py @@ -290,7 +290,10 @@ def meta(entries = FILES): for filename in entries: mtime = os.path.getmtime(filename) - wc = subprocess.check_output(["wc","-w",filename]).split()[0] + try: + wc = subprocess.check_output(["wc","-w",filename], stderr=subprocess.STDOUT).split()[0] + except subprocess.CalledProcessError: + wc = "???" timestamp = time.strftime("%Y-%m-%d at %H:%M", time.localtime(mtime)) date = "-".join(parse_date(filename)) author = os.path.split(os.path.split(os.path.split(os.path.split(filename)[0])[0])[0])[1]