From b7db7333e3561f095834d273de2144b124aa4410 Mon Sep 17 00:00:00 2001 From: Maciek Sufa Date: Mon, 12 Dec 2016 17:55:01 +0100 Subject: [PATCH] Fix outfile encoding --- setup.py | 2 +- tridinjector/injector.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ae67553..a3432ea 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name='tracking-id-injector', - version='1.0.0', + version='1.0.1', url='https://github.com/msufa/tracking-id-injector', author='Maciek Sufa', description=('Console script for injecting Google Analytics tracking IDs ' diff --git a/tridinjector/injector.py b/tridinjector/injector.py index 6158cfa..958173b 100644 --- a/tridinjector/injector.py +++ b/tridinjector/injector.py @@ -26,7 +26,7 @@ def _inject_tracking_id(tracking_id, soup): def _write_output(soup, output_filename): with open(output_filename, 'w') as outfile: - outfile.write(soup.prettify()) + outfile.write(soup.prettify().encode('utf-8')) def main():