[issue7350] csv doesn't handle escaped characters properly

2009-11-20 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue7350] csv doesn't handle escaped characters properly

2009-11-20 Thread Virgil Dupras

Virgil Dupras  added the comment:

You have to tell the reader how to handle escaping. In your case, you 
should send escapechar="\\" in reader()'s kwargs.

--
nosy: +vdupras

___
Python tracker 

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



[issue7350] csv doesn't handle escaped characters properly

2009-11-18 Thread Eric Torstenson

New submission from Eric Torstenson :

When I use CSV with a separator, if there is an escaped separator in the
field, it causes the next field to become part of the current one:

file = csv.reader(open(filename), delimiter='\t', quotechar="'")
for words in file:
print words[0-8]

If, say line 3 contains: '1709' 'PF01322'   'Cytochrom_C_2'
'Cytochrome_C_2; '  'Cytochrome C\'''Finn RD, Bateman A''anon'  
'Sarah
Teichmann'

Column 4 will be printed as:
Cytochrome C\'\tFinn RD, Bateman A'

I've checked this with a spreadsheet application, and it opened this
line just fine, but when I used csv to parse, I had to remove that
escaped single quote to get my columns to work out properly for that line.

--
components: Extension Modules
messages: 95441
nosy: est_python_tracker
severity: normal
status: open
title: csv doesn't handle escaped characters properly
type: behavior
versions: Python 2.6

___
Python tracker 

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