replace_newlines(): no os.linesep, don't depend on dict order.