[issue1606092] csv module broken for unicode

2009-11-25 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

This is indeed fixed in Python 3.  If someone wishes to step forward
with patches for 2.7, they can reopen this bug, but I don't think it is
worth the effort.

--
nosy: +r.david.murray
resolution:  - out of date
stage:  - committed/rejected
status: open - closed
type:  - feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1606092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1606092] csv module broken for unicode

2009-11-24 Thread Craig McQueen

Changes by Craig McQueen ces-...@mcqueen.id.au:


--
nosy: +cmcqueen1975

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1606092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1606092] csv module broken for unicode

2009-11-24 Thread Craig McQueen

Craig McQueen ces-...@mcqueen.id.au added the comment:

I think I see now--it accepts Unicode input, but converts it back to
bytes internally using the ASCII codec. So it works as long as the
Unicode input contains on ASCII characters. That's a gotcha.

It appears that it's been fixed in Python 3.x, judging by the documentation.

--
versions: +Python 2.4, Python 2.5, Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1606092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1606092] csv module broken for unicode

2008-09-10 Thread Mike Statkus

Mike Statkus [EMAIL PROTECTED] added the comment:

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])

--
nosy: +mstatkus

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1606092
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com