Commit cadf4598 authored by Tres Seaver's avatar Tres Seaver

Collector #2263: 'field2ulines' did not convert empty string correctly.

o Forward-port from 2.8 branch.
parent b6873816
......@@ -154,9 +154,18 @@ class field2utext(_unicode_converter):
return unicode(field2text(v.encode('utf8')),'utf8')
field2utext = field2utext()
class field2ulines(_unicode_converter):
def convert_unicode(self,v):
return field2utext.convert_unicode(v).split('\n')
class field2ulines:
def __call__(self, v):
if hasattr(v,'read'):
v=v.read()
if isinstance(v, (ListType, TupleType)):
return [field2ustring(x) for x in v]
v = unicode(v)
return self.convert_unicode(v)
def convert_unicode(self, v):
return field2utext.convert_unicode(v).splitlines()
field2ulines = field2ulines()
type_converters = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment