changeset 107:ee2b105d772a

minor fix
author Jan Kanis <jan.code@jankanis.nl>
date Mon, 07 Jul 2014 12:20:28 +0200
parents ed71448ee154
children 1faac255ae3c
files blast2html.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/blast2html.py	Mon Jul 07 11:50:50 2014 +0200
+++ b/blast2html.py	Mon Jul 07 12:20:28 2014 +0200
@@ -455,7 +455,7 @@
         # argument, so for python 2 we need to wrap or reopen the
         # output. The input files are already read as utf-8 by the
         # respective libraries.
-
+        #
         # One option is using codecs, but the codecs' writelines()
         # method doesn't support streaming but collects all output and
         # writes at once (see Python issues #5445 and #21910). On the
@@ -463,6 +463,12 @@
         # significantly).
 
         # args.output = codecs.getwriter('utf-8')(args.output)
+        # def fixed_writelines(iter, self=args.output):
+        #     for i in iter:
+        #         self.write(i)
+        # args.output.writelines = fixed_writelines
+
+        args.output.close()
         args.output = io.open(args.output.name, 'w')
     
     templatedir, templatename = path.split(args.template.name)