[Python-checkins] python/nondist/sandbox/csv csv.py,1.33,1.34

montanaro@users.sourceforge.net montanaro@users.sourceforge.net
Wed, 26 Feb 2003 14:33:53 -0800


Update of /cvsroot/python/python/nondist/sandbox/csv
In directory sc8-pr-cvs1:/tmp/cvs-serv5422

Modified Files:
	csv.py 
Log Message:
try to match behavior of the underlying C code (without actually looking at
the code ;-)


Index: csv.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/csv/csv.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** csv.py	26 Feb 2003 20:59:05 -0000	1.33
--- csv.py	26 Feb 2003 22:33:48 -0000	1.34
***************
*** 57,67 ****
              errors.append("skipinitialspace parameter must be True or False")
  
          if self.quoting is None:
              errors.append("quoting parameter not set")
-         elif self.quoting == QUOTE_NONE and self.escapechar is None:
-             errors.append("escapechar must be set when quoting is QUOTE_NONE")
- 
-         if self.escapechar is None and self.doublequote == False:
-             errors.append("escapechar must be set when doublequote is False")
  
          return errors
--- 57,66 ----
              errors.append("skipinitialspace parameter must be True or False")
  
+         if (not isinstance(self.escapechar, str) or
+             len(self.escapechar) > 1):
+             errors.append("escapechar must be one-character string")
+ 
          if self.quoting is None:
              errors.append("quoting parameter not set")
  
          return errors