[snip] > Is there a way to enable '\r' for read() method on Windows, or to code > it intelligently :-) to handle it. (by means of either completely not > caring about line feeds, or accounting '\r') Very easy to fix. Open the file in binary mode: f = open(myfile, 'rb')