fixed csv_reader
@@ -101,9 +101,7 @@ DEFAULT_REGEX = {
def csv_reader(utf8_data, dialect=csv.excel, encoding="utf-8", **kwargs):
"""like csv.reader but allows to specify an encoding, defaults to utf-8"""
- csv_reader = csv.reader(utf8_data if isinstance(utf8_data,TextIOWrapper)
- else TextIOWrapper(utf8_data,encoding),
- dialect=dialect, **kwargs)
+ csv_reader = csv.reader(utf8_data, dialect=dialect, **kwargs)
for row in csv_reader:
yield [to_unicode(cell, encoding) for cell in row]
