Fix line ending weirdness in Python