Commits

Evgeniy Tatarkin committed 908c61f

change default fileopen method on CsvPipeline

  • Participants
  • Parent commits 7a1a0e9

Comments (0)

Files changed (1)

pomp/contrib/pipelines.py

 Simple pipelines
 """ 
 import csv
+import codecs
 from pomp.core.base import BasePipeline
 from pomp.core.utils import isstring
 
 
     def start(self, crawler):
         if isstring(self.output_file):
-            self.csvfile = open(self.output_file, 'a', newline='')
+            self.csvfile = codecs.open(self.output_file, 'w', encoding='utf-8')
             self._need_close = True
         else:
             self.csvfile = self.output_file