From 289c6ecb787a4372ee79c2653a36847dad70b371 Mon Sep 17 00:00:00 2001 From: b3yond Date: Tue, 11 Jul 2017 21:42:32 +0200 Subject: [PATCH] make retootbot python2 compatible --- retootbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retootbot.py b/retootbot.py index 581770c..879a948 100644 --- a/retootbot.py +++ b/retootbot.py @@ -71,7 +71,7 @@ class RetootBot(object): retoots.append(text_content) # save state - with open('seen_toots.pickle.part', 'xb') as f: + with os.fdopen(os.open('seen_toots.pickle.part', os.O_WRONLY | os.O_EXCL | os.O_CREAT), 'w') as f: pickle.dump(self.seen_toots, f) os.rename('seen_toots.pickle.part', 'seen_toots.pickle')