any '\n' characters written are
  translated to the system default line separator, os.linesep. If
  newline is '', no translation takes place. If newline is any of the
  other legal values, any '\n' characters written are translated to
  the given string.

If line_buffering is True, a call to flush is implied when a call to
write contains a newline character.