From 529191aad6b7e31827d3d4afa9f629ac757745cf Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Sat, 16 Sep 2017 00:18:27 +0200 Subject: [PATCH] bytes to strings tapdance --- screenless/bureau/publicrelations/publicrelations.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/screenless/bureau/publicrelations/publicrelations.py b/screenless/bureau/publicrelations/publicrelations.py index 5263808..47eb5d2 100644 --- a/screenless/bureau/publicrelations/publicrelations.py +++ b/screenless/bureau/publicrelations/publicrelations.py @@ -64,9 +64,10 @@ class PublicRelations(Bureau): take a tweet id and return a short alphanumeric code """ shortcode = ''.join(random.choice(string.ascii_letters + string.digits) - for _ in range(5)).encode() + for _ in range(5)) with self.dbenv.begin(db=self.tweetdb, write=True) as txn: - txn.put(shortcode, tweet_id.encode()) + txn.put(shortcode.encode(), tweet_id.encode()) + return shortcode @add_command("tweetpic", "Post a Document Camera Image to Twitter") def tweet_pic(self):