Skip to content

Commit

Permalink
Fix max newlines messing with CSV
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-wieser committed Mar 6, 2017
1 parent 310f0e7 commit ebe499e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ballotadmin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta
import csv
import StringIO
from io import StringIO
import json
import re
import decimal
Expand Down Expand Up @@ -323,7 +323,8 @@ def edit_ballot_slots(ballot_id, ballot_type_name, db):

step2 = None
if request.method == "POST" and request.files.slot_csv:
raw_data, parse_errors = parse_csv(iter(request.files.slot_csv.file))
with StringIO(request.files.slot_csv.file.read(), newline=None) as f:
raw_data, parse_errors = parse_csv(f)

data, data_errors = process_slot_tuples(db, raw_data)

Expand Down

0 comments on commit ebe499e

Please sign in to comment.