Fix for CSV export unnecessary blank lines problem on Windows (#3039)

This commit is contained in:
Oz T 2018-07-04 00:22:24 +03:00 committed by Daniel Graña
parent 74ce156154
commit 6f5c39d65f
1 changed files with 2 additions and 1 deletions

View File

@ -214,7 +214,8 @@ class CsvItemExporter(BaseItemExporter):
file,
line_buffering=False,
write_through=True,
encoding=self.encoding
encoding=self.encoding,
newline='' # Windows needs this https://github.com/scrapy/scrapy/issues/3034
) if six.PY3 else file
self.csv_writer = csv.writer(self.stream, **kwargs)
self._headers_not_written = True