Add backslash escape support for cvs reader

This commit is contained in:
John Dennis 2011-06-15 13:06:14 -04:00 committed by Rob Crittenden
parent 4c1bfdb919
commit 032b77ac23
2 changed files with 4 additions and 2 deletions

View File

@ -1404,7 +1404,8 @@ class List(Param):
def __unicode_csv_reader(self, unicode_csv_data, dialect=csv.excel, **kwargs):
# csv.py doesn't do Unicode; encode temporarily as UTF-8:
csv_reader = csv.reader(self.__utf_8_encoder(unicode_csv_data),
dialect=dialect, delimiter=self.separator,
dialect=dialect,
delimiter=self.separator, escapechar='\\',
skipinitialspace=self.skipspace,
**kwargs)
for row in csv_reader:

View File

@ -141,7 +141,8 @@ class LDAPUpdate:
def __unicode_csv_reader(self, unicode_csv_data, quote_char="'", dialect=csv.excel, **kwargs):
# csv.py doesn't do Unicode; encode temporarily as UTF-8:
csv_reader = csv.reader(self.__utf_8_encoder(unicode_csv_data),
dialect=dialect, delimiter=',',
dialect=dialect,
delimiter=',', escapechar='\\',
quotechar=quote_char,
skipinitialspace=True,
**kwargs)