Updates:
        Owner: pekka.klarck

Comment #3 on issue 510 by pekka.klarck: Output files use Unix line endings on Windows
http://code.google.com/p/robotframework/issues/detail?id=510

This has now been fixed and acceptance tested.

While looking at this I learned something new about how Python handles lines separators:

1) If file is opened in text mode ('w', 'r' or 'a') on Windows, '\n' is automatically translated to '\r\n' when writing and '\r\n' to '\n' when reading. No translation is done on other platforms.

2) If file is opened in binary mode ('wb', 'rb' or 'ab'), no translation is done on any platform.

3) codecs.open forces binary mode to prevent possible data corruption. That is highly annoying and also stupid because text mode would be safe with most encodings (and is safe with UTF-8)). This annoyance means that all '\n' characters must be replaced with os.linesep when reading/writing. That is often more work than using normal open and encoding/decoding content to UTF-8 when writing/reading.

Reply via email to