Skip to content

Commit

Permalink
Merge pull request #190 from cpcloud/fix-windows-compression
Browse files Browse the repository at this point in the history
Fix some lingering compression with encoding issues on windows py34 and py27
  • Loading branch information
cpcloud committed May 2, 2015
2 parents 170219f + c21d64a commit 57ac776
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion odo/backends/csv.py
Expand Up @@ -92,9 +92,11 @@ def append_dataframe_to_csv(c, df, dshape=None, **kwargs):
encoding=kwargs.get('encoding', c.encoding)

if ext(c.path) in compressed_open:
kwargs = dict(mode='at')
if sys.version_info[0] >= 3:
kwargs['mode'] = 'at'
kwargs['encoding'] = encoding
elif sys.version_info[0] == 2:
kwargs['mode'] = 'ab' if sys.platform == 'win32' else 'at'
f = compressed_open[ext(c.path)](c.path, **kwargs)
else:
f = c.path
Expand Down

0 comments on commit 57ac776

Please sign in to comment.