]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
rename "error" kwarg to "errors" to be consistent with builtin unicode
authorGaëtan de Menten <gdementen@gmail.com>
Tue, 23 Feb 2010 20:41:23 +0000 (20:41 +0000)
committerGaëtan de Menten <gdementen@gmail.com>
Tue, 23 Feb 2010 20:41:23 +0000 (20:41 +0000)
conversion functions.

lib/sqlalchemy/processors.py

index 2bf9221b7ceaad8453aeb041c7c37d3f53987baa..4cf6831bd557b2e1eea464bdc577747eba1979a2 100644 (file)
@@ -32,10 +32,10 @@ try:
                                        str_to_datetime, str_to_time, \
                                        str_to_date
 
-    def to_unicode_processor_factory(encoding, error=None):
-        # TODO: this is cumbersome
-        if error is not None:
-            return UnicodeResultProcessor(encoding, error).process
+    def to_unicode_processor_factory(encoding, errors=None):
+        # this is cumbersome but it would be even more so on the C side
+        if errors is not None:
+            return UnicodeResultProcessor(encoding, errors).process
         else:
             return UnicodeResultProcessor(encoding).process
 
@@ -43,7 +43,7 @@ try:
         return DecimalResultProcessor(target_class).process
 
 except ImportError:
-    def to_unicode_processor_factory(encoding, error=None):
+    def to_unicode_processor_factory(encoding, errors=None):
         decoder = codecs.getdecoder(encoding)
 
         def process(value):
@@ -54,7 +54,7 @@ except ImportError:
                 # len part is safe: it is done that way in the normal
                 # 'xx'.decode(encoding) code path.
                 # cfr python-source/Python/codecs.c:PyCodec_Decode
-                return decoder(value, error)[0]
+                return decoder(value, errors)[0]
         return process
 
     def to_decimal_processor_factory(target_class):