Author mstatkus
Recipients jettlogic, lemburg, loewis, mstatkus, skip.montanaro
Date 2008-09-10.11:37:47
SpamBayes Score 5.33278e-06
Marked as misclassified No
Message-id <1221046672.16.0.359573864052.issue1606092@psf.upfronthosting.co.za>
In-reply-to
Content
Example of UnicodeWriter.writerow(self,row) presented in Python 2.5
Manual at section 9.1.5 (Examples on CSV module of standard library)
does not correctly process rows containing not only strings, but also
int type values, raising an attribute error. 
1st line of code in UnicodeWriter.writerow:
self.writer.writerow([s.encode("utf-8") for s in row])
tries to call .encode() method for s, that might be an int, not a
string. A simple workaround is:
self.writer.writerow([unicode(s).encode("utf-8") for s in row])
History
Date User Action Args
2008-09-10 11:37:52mstatkussetrecipients: + mstatkus, lemburg, loewis, skip.montanaro, jettlogic
2008-09-10 11:37:52mstatkussetmessageid: <1221046672.16.0.359573864052.issue1606092@psf.upfronthosting.co.za>
2008-09-10 11:37:47mstatkuslinkissue1606092 messages
2008-09-10 11:37:47mstatkuscreate