Handles pkg_resources byte strings in Python 3 correctly

pull/82/head^2
Scott 8 years ago
parent 284be84678
commit 2b6a6ff51e

@ -20,11 +20,11 @@ def main():
if args.generate_configs: if args.generate_configs:
if not os.path.isfile("shreddit.yml"): if not os.path.isfile("shreddit.yml"):
print("Writing shreddit.yml file...") 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")) fout.write(pkg_resources.resource_string("shreddit", "shreddit.yml.example"))
if not os.path.isfile("praw.ini"): if not os.path.isfile("praw.ini"):
print("Writing praw.ini file...") 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")) fout.write(pkg_resources.resource_string("shreddit", "praw.ini.example"))
return return

Loading…
Cancel
Save