I was working on a wiki app in Django, and had a textarea where the user submits markdown text. The string content would be passed to django.core.files.base.ContentFile(content), and then this would be saved via django.core.files.storage.default_storage.save(filename, ContentFile(content)). However, the saved markdown file (it was the same with .txt files) would have double the number of newlines as what the user entered. I have Windows and the program must have tried to convert the Windows-formatted data to Windows again, thinking that it was in Unix. CR LF was being converted to CR CR LF. I fixed this by using bytes(content, 'utf8') before passing it to the save function. My question is, why did this work? What did bytes() do to the data and its newline characters so that the program no longer thought it was in unix?