Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue1606092] csv module broken for unicode

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 24, 2009, 6:44 PM

Post #1 of 4 (334 views)
Permalink
[issue1606092] csv module broken for unicode

Changes by Craig McQueen <ces-pub [at] mcqueen>:


----------
nosy: +cmcqueen1975

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1606092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 24, 2009, 6:48 PM

Post #2 of 4 (316 views)
Permalink
[issue1606092] csv module broken for unicode [In reply to]

Craig McQueen <ces-pub [at] mcqueen> added the comment:

Is this still an open bug? I have the following code:

lookup = {}
csv_reader = csv.reader(codecs.open(lookup_file_name, 'r', 'utf-8'))
for row in csv_reader:
lookup[row[1]] = row[0]

And it "appears to work" (it runs) using Python 2.6.2. So has this bug
been fixed?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1606092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 24, 2009, 7:07 PM

Post #3 of 4 (325 views)
Permalink
[issue1606092] csv module broken for unicode [In reply to]

Craig McQueen <ces-pub [at] mcqueen> 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 <report [at] bugs>
<http://bugs.python.org/issue1606092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 25, 2009, 4:17 AM

Post #4 of 4 (314 views)
Permalink
[issue1606092] csv module broken for unicode [In reply to]

R. David Murray <rdmurray [at] bitdance> 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 <report [at] bugs>
<http://bugs.python.org/issue1606092>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.