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:
Daiki Ueno 2013-08-16 17:44:14 +02:00
parent 1e945933d4
commit a7f2765dba

View File

@ -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)