Using t in environments without Posix (for example, MSDOS and MS Windows), the sequence \r\n converted to \n at the input (and vice versa at the output). b (binary mode) does not perform such a translation.
Presumably, the CSV library deals with carriage returns (perhaps ignoring them every time it encounters them). A.
Edit: Just noticed a modified question.
Since .CSV files are not really intended for readers, the library can only output them with delimiters \n (linefeed (LF) aka newline). They would only be a real flaw for an MSWindows user opening a file with Notepad: it will not display well. The CSV library can also output files with \r\n (CR LF), since most programs protect against MSDOS conventions.
In any case, the library can write via b (binary) mode just fine. It is possible that if it is opened in t (text) mode, line separators will have something a bit strange like \r\n\n . Most CSV parsers probably ignore CR and recognize LF LF as the end of a line and follow it with an empty (empty) line, which is also ignored.
+ explained on the page:
w + strong> Open for reading and writing. A file is created if it does not exist, otherwise it is truncated. The stream located at the beginning of the file.
The difference is that w+ allows reading and writing, while w allows writing.
source share