The parser is able to convert data from binary to XML (it generates an
empty <Value> tag) but not the other way around. This is a common
occurrence for empty multitext fields.
Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
if misc.REG_MULTI_SZ == entry_type:
values = [x.text for x in e.findall('Value')]
- entry.data = (u'\x00'.join(values) + u'\x00\x00').encode('utf-16le')
+ if values == [None]:
+ data = u'\x00'
+ else:
+ data = u'\x00'.join(values) + u'\x00\x00'
+ entry.data = data.encode('utf-16le')
elif (misc.REG_NONE == entry_type):
pass
elif (misc.REG_SZ == entry_type or
+++ /dev/null
-^samba.tests.gpo.samba.tests.gpo.GPOTests.test_parser_roundtrip_empty_multi_sz