diff options
Diffstat (limited to 'imdb-lookup')
-rwxr-xr-x | imdb-lookup/imdbinfo.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/imdb-lookup/imdbinfo.py b/imdb-lookup/imdbinfo.py index 1e60fa7..5a4c7fe 100755 --- a/imdb-lookup/imdbinfo.py +++ b/imdb-lookup/imdbinfo.py @@ -179,8 +179,11 @@ def do_index(args, imdb_ids): 'title' : 'Movie overview', } assert not os.path.exists("index.html"), "index.html already exists" - output = template.render(mapping).encode("utf-8") - open("index.html", "wb").write(output) + stream = template.generate(mapping) + outfile = open("index.html", "wb") + for output in stream: + output = output.encode("utf-8") + outfile.write(output) class HelpAction(argparse._HelpAction): def __call__(self, parser, namespace, values, option_string=None): |