Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target csv on Windows adds extra line #28

Open
charleslukowski opened this issue Jan 9, 2015 · 1 comment
Open

Target csv on Windows adds extra line #28

charleslukowski opened this issue Jan 9, 2015 · 1 comment

Comments

@charleslukowski
Copy link

Using Windows and Python 2.7 I get an extra line between all rows of my output.

screenclip 15

@coolestpizzadude
Copy link

I had the same issue (on windows , python 2.7.10). It can be resolved by modifying 2 lines in the the file:
metl/source/base.py in OpenResource
Line 46 reads:
file_pointer = codecs.open( resource, mode, encoding )
I changed it into:
file_pointer = codecs.open( resource, mode+'b', encoding )

Line 49 reads:
file_pointer = codecs.open( resource, mode )
I changed it into:
file_pointer = codecs.open( resource, mode+'b' )

This means the mode parameter only gets changed if the resource is a file (and not an URL). Adding the 'b' seems necessary on windows (and it doesn't do anything on Linux, so it should be fine).
Maybe there is a more elegant solution, but this seems to work fine for me.

cheers!
Coolestpizzadude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants