mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
python/samba/gp_parse: PY2/PY3 compat porting for gp_init.py
Fixes 1) use compat versions of ConfigParser and StringIO 2) fix sort list of XML Elements 3) open file needs to be opened in binary mode as write_pretty_xml routing uses BytesIO() object. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
parent
d40ef736d5
commit
cf79e6ae15
@ -70,7 +70,7 @@ class GPIniParser(GPParser):
|
||||
return section_name
|
||||
|
||||
def write_xml(self, filename):
|
||||
with open(filename, 'w') as f:
|
||||
with open(filename, 'wb') as f:
|
||||
root = Element('IniFile')
|
||||
|
||||
for sec_ini in self.ini_conf.sections():
|
||||
|
Loading…
Reference in New Issue
Block a user