Re: module: zipfile.writestr - line endings issue

2007-08-15 Thread Paul Carter
On Aug 15, 3:33 am, Suresh Babu Kolla <[EMAIL PROTECTED]> wrote: > Paul Carter wrote: > > > 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 =

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-15 Thread Suresh Babu Kolla
Paul Carter wrote: > On Aug 14, 1:32 pm, towers <[EMAIL PROTECTED]> wrote: >> Thanks - your code works for me also. >> >> But I still get the issue when I read the file directly and add it to >> the archive. >> >> Say if I: >> >> 1. Use the test.csv file created with your code - currently the line

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread Paul Carter
On Aug 14, 1:32 pm, towers <[EMAIL PROTECTED]> wrote: > Thanks - your code works for me also. > > But I still get the issue when I read the file directly and add it to > the archive. > > Say if I: > > 1. Use the test.csv file created with your code - currently the line > endings look good (viewed i

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread towers
Thanks - your code works for me also. But I still get the issue when I read the file directly and add it to the archive. Say if I: 1. Use the test.csv file created with your code - currently the line endings look good (viewed in notepad on Win XP) 2. Run the following code: # begin code import

Re: module: zipfile.writestr - line endings issue

2007-08-14 Thread [EMAIL PROTECTED]
On Aug 14, 11:04 am, towers <[EMAIL PROTECTED]> wrote: > 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 a

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