From c9874873c96397fc3ca75103c78e109096b4fa61 Mon Sep 17 00:00:00 2001 From: Drew Crawford Date: Sat, 9 Aug 2014 01:52:29 -0500 Subject: [PATCH] Use of a binary string was necessary in py3.4 to avoid throwing an exception There appears to be a mismatch here between the regex and the string being searched, this resolves it Not tested on earlier versions of python --- shreddit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shreddit.py b/shreddit.py index 83c0fb8..0e34b7f 100755 --- a/shreddit.py +++ b/shreddit.py @@ -132,7 +132,7 @@ for thing in things: if verbose: msg = '/r/{3}/ #{0} with:\n\t"{1}" to\n\t"{2}"'.format( thing.id, - sub(r'\n\r\t', ' ', thing.body[:78].encode('utf-8')), + sub(b'\n\r\t', ' ', thing.body[:78].encode('utf-8')), replacement_text[:78], thing.subreddit )