Using bytestrings for ascii text isn't a good idea, you should leave it in unicode. Just read and write the file using the default encoding, but with an explicit "newline" on the write:
with open(in_file, "r") as input:
data = input.read()
with open(out_file, "w", newline="\n") as output:
output.write(data)
(Where the hell is the BBcode-like [code] block on this crappy forum?)
Using bytestrings for ascii text isn't a good idea, you should leave it in unicode. Just read and write the file using the default encoding, but with an explicit "newline" on the write:
with open(in_file, "r") as input:
data = input.read()
with open(out_file, "w", newline="\n") as output:
output.write(data)
(Where the hell is the BBcode-like [code] block on this crappy forum?)