From 681b173a9d3dbf9d7cfb08e1273bcf9f368f5a70 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Thu, 16 Jun 2016 00:44:44 -0400 Subject: [PATCH] Strip empty lines in bookmark files (fixes #30) --- gitup/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gitup/config.py b/gitup/config.py index cb6c742..1e664b9 100644 --- a/gitup/config.py +++ b/gitup/config.py @@ -32,10 +32,11 @@ def _load_config_file(config_path=None): try: with open(cfg_path, "rb") as config_file: - paths = config_file.read().strip().split(b"\n") - return [path.decode("utf8") for path in paths] + paths = config_file.read().split(b"\n") except IOError: return [] + paths = [path.decode("utf8").strip() for path in paths] + return [path for path in paths if path] def _save_config_file(bookmarks, config_path=None): """Save the bookmarks list to the given config file."""