From: Gaƫtan de Menten Date: Tue, 23 Feb 2010 20:41:23 +0000 (+0000) Subject: rename "error" kwarg to "errors" to be consistent with builtin unicode X-Git-Tag: rel_0_6beta2~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be3fc76bb5d8ffdad89f9acbd345c1ea04046383;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git rename "error" kwarg to "errors" to be consistent with builtin unicode conversion functions. --- diff --git a/lib/sqlalchemy/processors.py b/lib/sqlalchemy/processors.py index 2bf9221b7c..4cf6831bd5 100644 --- a/lib/sqlalchemy/processors.py +++ b/lib/sqlalchemy/processors.py @@ -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):