Re: Problem with zipfile and newlines

2008-03-11 Thread neilcrighton
Sorry my initial post was muddled. Let me try again. I've got a zipped archive that I can extract files from with my standard archive unzipping program, 7-zip. I'd like to extract the files in python via the zipfile module. However, when I extract the file from the archive with ZipFile.read(), it

Re: Problem with zipfile and newlines

2008-03-11 Thread neilcrighton
I think I've worked it out after reading the 'Binary mode for files' section of http://zephyrfalcon.org/labs/python_pitfalls.html zipfile extracts as file as a binary series of characters, and I'm writing out this binary file as a text file with open('foo','w'). Normally Python converts a '\n' in