Skip to content

Commit bfe8393

Browse files
author
Alan Christie
committed
- Gzip files now written as 'at', read as 'rt' (was 'w+' and None)
- A fix for problems in Python 3
1 parent 6cfb5c7 commit bfe8393

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/python/pipelines_utils/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def round_sig(x, sig):
3535
def open_file(filename):
3636
"""Open the file gunzipping it if it ends with .gz"""
3737
if filename.lower().endswith('.gz'):
38-
return gzip.open(filename)
38+
return gzip.open(filename, 'rt')
3939
else:
4040
return open(filename, 'r')
4141

@@ -68,7 +68,7 @@ def open_output(basename, ext, compress):
6868
fname = basename + '.' + ext
6969
if compress:
7070
fname += ".gz"
71-
return gzip.open(fname, 'w+')
71+
return gzip.open(fname, 'at')
7272
else:
7373
return open(fname, 'w+')
7474
else:

src/python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def get_long_description():
1313
setup(
1414

1515
name='im-pipelines-utils',
16-
version='2.2.1',
16+
version='2.2.2',
1717
author='Alan Christie',
1818
author_email='[email protected]',
1919
url='https://github.com/InformaticsMatters/pipelines-utils',

0 commit comments

Comments
 (0)