mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-03 17:56:17 +01:00
codegen: Treat input file as binary
Under C locale, open() in Python 3 sets the file encoding to ASCII. As expat looks at encoding="..." in XML declaration, gdbus-codegen can simply open the input file as binary and let expat decode the content. https://bugzilla.gnome.org/show_bug.cgi?id=696633
This commit is contained in:
parent
1e945933d4
commit
a7f2765dba
@ -166,7 +166,7 @@ def codegen_main():
|
|||||||
|
|
||||||
all_ifaces = []
|
all_ifaces = []
|
||||||
for fname in args:
|
for fname in args:
|
||||||
f = open(fname)
|
f = open(fname, 'rb')
|
||||||
xml_data = f.read()
|
xml_data = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
parsed_ifaces = parser.parse_dbus_xml(xml_data)
|
parsed_ifaces = parser.parse_dbus_xml(xml_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user