Apparently on a Windows system \r\n
must be used, instead of \n
on a Linux system. Worked for me.
See See here forHow can I force Python's file.write() to use the same newline format in Windows as in Linux (slightly“\r\n” vs. “\n”) more details? at Stack Overflow for (slightly) more details.