Do newline stripping better than str().strip()