From: Diane Trout Date: Thu, 29 Jan 2015 22:14:57 +0000 (-0800) Subject: assume we are writing text with gzip X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=d627faeb6825accc1fe89f85288bf48d7fabd77e assume we are writing text with gzip --- diff --git a/htsworkflow/pipelines/desplit_fastq.py b/htsworkflow/pipelines/desplit_fastq.py index c9947a2..b6d740c 100644 --- a/htsworkflow/pipelines/desplit_fastq.py +++ b/htsworkflow/pipelines/desplit_fastq.py @@ -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: diff --git a/htsworkflow/pipelines/test/simulate_runfolder.py b/htsworkflow/pipelines/test/simulate_runfolder.py index 0d48787..88e69e1 100644 --- a/htsworkflow/pipelines/test/simulate_runfolder.py +++ b/htsworkflow/pipelines/test/simulate_runfolder.py @@ -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()