On Aug 20, 9:10 am, MRAB <pyt...@mrabarnett.plus.com> wrote: > JonathanB wrote: > > On Aug 13, 3:52 pm, alex23 <wuwe...@gmail.com> wrote: > >> On Aug 13, 4:22 pm, JonathanB <doulo...@gmail.com> wrote: > > >>> writer = csv.writer(open(output, 'w'), dialect='excel') > >> I think - not able to test atm - that if you open the file in 'wb' > >> mode instead it should be fine. > > > changed that to > > writer = csv.writer(open(output,'wb'),dialect='excel') > > > Now I get this error: > > > TypeError: must be bytes or buffer, not str > > > I'm using Python 3.1, maybe that changes things? > > You want to open the file in text mode, but not write Windows line > endings (CRLF) for each newline: > > writer = csv.writer(open(output, 'w', newline=''), dialect='excel')
That was it! Thank you, I knew it was something stupid. It's been so long (6 months) since I coded, I forgot about how Windows/Mac mangle line endings. -- http://mail.python.org/mailman/listinfo/python-list