From 48f6bbf482594201cea2b4da159b22171e410109 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 21 May 2020 23:23:15 +0100 Subject: [PATCH] Ensure that line endings are removed --- bookmarks.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bookmarks.py b/bookmarks.py index b4ca12dd..160e5b0a 100644 --- a/bookmarks.py +++ b/bookmarks.py @@ -51,14 +51,12 @@ def undoBookmarksCollectionEntry(recentPostsCache: {}, bookmarkIndex = postFilename.split('/')[-1].strip() else: bookmarkIndex = postFilename.strip() + bookmarkIndex = bookmarkIndex.replace('\n', '') if bookmarkIndex not in open(bookmarksIndexFilename).read(): return indexStr = '' - indexStrChanged = False with open(bookmarksIndexFilename, 'r') as indexFile: indexStr = indexFile.read().replace(bookmarkIndex + '\n', '') - indexStrChanged = True - if indexStrChanged: bookmarksIndexFile = open(bookmarksIndexFilename, 'w') if bookmarksIndexFile: bookmarksIndexFile.write(indexStr)