Re: module: zipfile.writestr - line endings issue

2007-08-15 Thread towers
> > Please don't top post. > > > The problem is with how you are opening the file. You need to open in > > binary mode if you wish to read your file unaltered. Also, file() is > > preferred over open() these days I think. Use: > > > dfile = file('test.csv', 'rb') > > From Python 2.5 library docume

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread towers
3. Then extract the file and the file endings have been corrupted. Now one long line in notepad. (Other programs interpret correctly though.) Maybe the issue lies with this way (i.e. dfile.read()) of writing the file to the archive...possibly. Damon On 14 Aug, 17:55, "[EMAIL PROTECTED]&qu

module: zipfile.writestr - line endings issue

2007-08-14 Thread towers
Hi I'm probably doing something stupid but I've run into a problem whereby I'm trying to add a csv file to a zip archive - see example code below. The csv just has several rows with carriage return line feeds (CRLF). However after adding it to an archive and then decompressing the line endings