Skip to content
Snippets Groups Projects
Commit d37ee8c2 authored by Christian Boltz's avatar Christian Boltz Committed by Ben Adida
Browse files

Open voter_stream in rb (binary) mode

... which is what unicodecsv.reader expects.

This reverts 35b5cdab which causes the
tests to error out with

```
======================================================================
ERROR: test_add_voters_file (helios.tests.ElectionModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/helios-server/helios/tests.py", line 80, in test_add_voters_file
    vf.process()
  File "/tmp/helios-server/helios/models.py", line 806, in process
    voters = list(self.itervoters())
  File "/tmp/helios-server/helios/models.py", line 767, in itervoters
    for voter_fields in reader:
  File "/usr/lib/python3.6/site-packages/unicodecsv/py3.py", line 55, in __next__
    return self.reader.__next__()
  File "/usr/lib/python3.6/site-packages/unicodecsv/py3.py", line 51, in <genexpr>
    f = (bs.decode(encoding, errors=errors) for bs in f)
AttributeError: 'str' object has no attribute 'decode'
```
parent 9a4b2951
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment