From 2b6a6ff51e38036fe662319dd8332c9dfe812bbf Mon Sep 17 00:00:00 2001 From: Scott Date: Tue, 13 Dec 2016 11:07:36 -0600 Subject: [PATCH] Handles pkg_resources byte strings in Python 3 correctly --- shreddit/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shreddit/app.py b/shreddit/app.py index 3064b1a..82521da 100644 --- a/shreddit/app.py +++ b/shreddit/app.py @@ -20,11 +20,11 @@ def main(): if args.generate_configs: if not os.path.isfile("shreddit.yml"): print("Writing shreddit.yml file...") - with open("shreddit.yml", "w") as fout: + with open("shreddit.yml", "wb") as fout: fout.write(pkg_resources.resource_string("shreddit", "shreddit.yml.example")) if not os.path.isfile("praw.ini"): print("Writing praw.ini file...") - with open("praw.ini", "w") as fout: + with open("praw.ini", "wb") as fout: fout.write(pkg_resources.resource_string("shreddit", "praw.ini.example")) return