summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2011-06-15 13:06:14 -0400
committerRob Crittenden <rcritten@redhat.com>2011-06-22 01:20:27 -0400
commit032b77ac23f2b92283e72cc7efcf787d22565abc (patch)
tree23680f34971fd48a2907da2d4aa06a0589953e8b
parent4c1bfdb9198bcf831282244b6666d9776529ab37 (diff)
downloadfreeipa-032b77ac23f2b92283e72cc7efcf787d22565abc.zip
freeipa-032b77ac23f2b92283e72cc7efcf787d22565abc.tar.gz
freeipa-032b77ac23f2b92283e72cc7efcf787d22565abc.tar.xz
Add backslash escape support for cvs reader
-rw-r--r--ipalib/parameters.py3
-rw-r--r--ipaserver/install/ldapupdate.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 1551df3..ee66084 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -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:
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 9d36ddd..2d9c473 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -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)