Bakes <ba...@ymail.com> writes: >> > As a quick fix, you can add a file.flush() line after the >> > file.write(...) line, and the problem should go away. >> >> Thank you very much, that worked perfectly. > > Actually, no it didn't. That fix works seamlessly in Linux, but gave > the same error in a Windows environment. Is that expected?
Consider opening the file in binary mode, by passing the 'wb' and 'ab' modes to open instead of 'w' and 'a' respectively. On Windows, python (and other languages) will convert '\n' to '\r\n' on write. -- http://mail.python.org/mailman/listinfo/python-list