nedbat / cog

Small bits of Python computation for static files
MIT License
340 stars 26 forks source link

Preserve file original line ending regardless the platform #11

Open evandrocoan opened 4 years ago

evandrocoan commented 4 years ago

As I am on Windows, Python open(file) will automatically use CRLF when saving the file, regardless whether the file was originally with LF line ending. By opening the file in binary mode, Python open(file) will stop converting the file line endings.