From 8751a6fa00dd9c7fa747ebf4f8b835ee0f9bf79b Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Fri, 31 Jul 2015 21:13:58 -0700 Subject: [PATCH] whee --- tildetown-py/stats.py | 2 -- tildetown-py/util.py | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tildetown-py/stats.py b/tildetown-py/stats.py index 11cf49b..28f20e7 100644 --- a/tildetown-py/stats.py +++ b/tildetown-py/stats.py @@ -28,13 +28,11 @@ def guarded_mtime(path): return 0 def modify_time(username): - p(username) files_to_mtimes = partial(map, guarded_mtime) return thread(username, username_to_html_path, bounded_find, files_to_mtimes, - p, list, max) diff --git a/tildetown-py/util.py b/tildetown-py/util.py index bc58dc0..7f29993 100644 --- a/tildetown-py/util.py +++ b/tildetown-py/util.py @@ -1,11 +1,12 @@ def slurp(file_path): contents = None try: - with open(file_path, 'r') as f: + with open(file_path, 'r', encoding="utf-8") as f: contents = f.read() except FileNotFoundError: pass - return contents + except UnicodeDecodeError: + return contents def thread(initial, *fns): value = initial