diff --git a/auth.py b/auth.py index d2aab591..a9b83a93 100644 --- a/auth.py +++ b/auth.py @@ -130,7 +130,7 @@ def storeBasicCredentials(baseDir: str, nickname: str, password: str) -> bool: os.rename(passwordFile + '.new', passwordFile) else: # append to password file - with open(passwordFile, "a") as passfile: + with open(passwordFile, 'a+') as passfile: passfile.write(storeStr + '\n') else: with open(passwordFile, "w") as passfile: diff --git a/follow.py b/follow.py index 3c6c6e1d..e14ab804 100644 --- a/follow.py +++ b/follow.py @@ -520,7 +520,7 @@ def storeFollowRequest(baseDir: str, approveFollowsFilename = accountsDir + '/followrequests.txt' if os.path.isfile(approveFollowsFilename): if approveHandle not in open(approveFollowsFilename).read(): - with open(approveFollowsFilename, "a") as fp: + with open(approveFollowsFilename, 'a+') as fp: fp.write(approveHandle + '\n') else: if debug: diff --git a/inbox.py b/inbox.py index 692b89c1..e4a27672 100644 --- a/inbox.py +++ b/inbox.py @@ -1581,7 +1581,7 @@ def populateReplies(baseDir: str, httpPrefix: str, domain: str, if numLines > maxReplies: return False if messageId not in open(postRepliesFilename).read(): - repliesFile = open(postRepliesFilename, "a") + repliesFile = open(postRepliesFilename, 'a+') repliesFile.write(messageId + '\n') repliesFile.close() else: