Skip to content

Commit

Permalink
Strip empty lines in bookmark files (fixes earwig#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
earwig committed Jun 16, 2016
1 parent 76b177f commit 681b173
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitup/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit 681b173

Please sign in to comment.