Changed '\n' to os.linesep