value = ''
if size > 0:
value = stream.read(size)
- value = value.rstrip(chr(0))
+ value = value.partition(chr(0))[0]
return value
value = u''
if size > 0:
data = stream.read(size)
- data = data.rstrip(chr(0))
+ data = data.partition(chr(0))[0]
value = unicode(data, 'utf_8')
return value