From bbdf3706a376bcde11aeaa563474a1a4e0b59f83 Mon Sep 17 00:00:00 2001 From: Egon Valdmees Date: Tue, 31 May 2011 14:58:59 +0300 Subject: [PATCH] error when fixing utf8 in rows with null values --- python/londiste/handlers/dispatch.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/londiste/handlers/dispatch.py b/python/londiste/handlers/dispatch.py index 72704ac2..83d7bc09 100644 --- a/python/londiste/handlers/dispatch.py +++ b/python/londiste/handlers/dispatch.py @@ -613,12 +613,12 @@ class EncodingValidator: return _unicode.encode(self.encoding) def validate_dict(self, data): - _cols, _vals = zip(*data.items()) - _fixed = self.validate('\t'.join(_vals), _cols) - if self.error_count == 0: - return data - else: - return dict(zip(_cols, _fixed.split('\t'))) + for _key, _val in data.items(): + if _val: + _fixed = self.validate(_val, [_key]) + if self.error_count != 0: + data[_key] = _fixed + return data -- 2.39.5