Commit b2331b5c authored by Okhin's avatar Okhin

Fixing the vote parser

parent f699df3c
Pipeline #1181 passed with stage
in 10 seconds
......@@ -56,7 +56,8 @@ class VoteSpider(BaseSpider):
# Ecriture atomique
with gzip.open('%s.tmp.gz' % outfile, 'wb') as f:
json.dump(votes, f, cls=ScrapyJSONEncoder)
f.write(json.loads(votes, cls=ScappyJSONEncoder).encode('utf-8'))
f.write('\n'.encode('utf-8'))
f.flush()
os.fsync(f.fileno())
......@@ -69,7 +70,7 @@ class VoteSpider(BaseSpider):
infile = self.vote_file(scrutin)
with gzip.open('%s.gz' % infile, 'rb') as f:
votes = json.load(f)
votes = json.loads(f.read().decode())
for v in votes:
yield v
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment