assume we are writing text with gzip
authorDiane Trout <diane@ghic.org>
Thu, 29 Jan 2015 22:14:57 +0000 (14:14 -0800)
committerDiane Trout <diane@ghic.org>
Thu, 29 Jan 2015 22:14:57 +0000 (14:14 -0800)
htsworkflow/pipelines/desplit_fastq.py
htsworkflow/pipelines/test/simulate_runfolder.py

index c9947a2ef2317b0a05f7c36e966eb152949fc1f3..b6d740c33df351388c21739b28e522a675dea249 100644 (file)
@@ -31,9 +31,9 @@ def main(cmdline=None):
 
     if opts.output is not None:
         if opts.bzip:
-            output = bz2.BZ2File(opts.output,'w')
+            output = bz2.BZ2File(opts.output, 'wt')
         elif opts.gzip:
-            output = gzip.GzipFile(opts.output, 'w')
+            output = gzip.GzipFile(opts.output, 'wt')
         else:
             output = open(opts.output, 'w')
     else:
index 0d48787abb25dfe8d6c77f4933e5ef6ce6c2706a..88e69e1925576f73bcc26dc120440342cb7fee68 100644 (file)
@@ -538,7 +538,7 @@ def make_aligned_eland_export(aligned_dir, flowcell_id):
             for read in UNALIGNED_READS:
                 suffix = 'R{0}_{1}_export.txt.gz'.format(read, split)
                 pathname = paths.make_test_filename(suffix)
-                stream = gzip.open(pathname, 'w')
+                stream = gzip.open(pathname, 'wt')
                 stream.write(body)
                 stream.close()
 
@@ -576,7 +576,7 @@ def make_unaligned_fastq_sample_1_12(unaligned_dir,
         for read in reads:
             suffix = 'R{0}_{1}.fastq.gz'.format(read, split)
             pathname = paths.make_test_filename(suffix)
-            stream = gzip.open(pathname, 'w')
+            stream = gzip.open(pathname, 'wt')
             stream.write(sample_seq)
             stream.close()