skidooesy / stv

Automatically exported from code.google.com/p/stv
0 stars 0 forks source link

TextReport assumes ballots are loaded from file #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is a follow up to Issue 34. Generating a TextReport for ballots loaded 
from a file-like object 
raises an AttributeError ('NoneType' object has no attribute 'rfind').

The faulty code is in the "generateHeader" method of the TextReport class. The 
call to 
"self.b0.getFileName()" returns "None" for ballots that aren't loaded from 
file, and this case is not 
handled.

Original issue reported on code.google.com by twoggle@gmail.com on 30 Nov 2009 at 10:31

GoogleCodeExporter commented 9 years ago
Is there any alternative inforimation we should include or should we just leave 
this line out of the report?

Original comment by jeff.oneill on 30 Nov 2009 at 10:54

GoogleCodeExporter commented 9 years ago
I think we should test for nullity and skip it if null, because it seems silly 
to
require all items to have what amounts to a piece of metadata.

Perhaps if we want other information, we could use a "comments" field and print 
that
out if not null.  (Not sure if we already have that--sorry if we do.)

Original comment by dan.keshet@gmail.com on 1 Dec 2009 at 4:35

GoogleCodeExporter commented 9 years ago
Makes sense.  We don't have a comments field,

Original comment by jeff.oneill on 1 Dec 2009 at 1:33

GoogleCodeExporter commented 9 years ago

Original comment by dan.keshet@gmail.com on 2 Dec 2009 at 2:15

GoogleCodeExporter commented 9 years ago
This should be fixed.  Please let us know if it is not.

Original comment by jeff.oneill on 12 Dec 2009 at 3:18