summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@unixuser.org>2013-08-16 17:44:14 +0200
committerDaiki Ueno <ueno@unixuser.org>2013-08-17 06:42:02 +0200
commita7f2765dbabf889df065e601fc072644dda625e4 (patch)
tree5601a458bb3a5e56d5c2193331628564e6849b5d
parent1e945933d4709131730294df0f9076a4424e6e1c (diff)
downloadglib-a7f2765dbabf889df065e601fc072644dda625e4.tar.gz
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
-rwxr-xr-xgio/gdbus-2.0/codegen/codegen_main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gio/gdbus-2.0/codegen/codegen_main.py b/gio/gdbus-2.0/codegen/codegen_main.py
index aa7984e28..69cf3e766 100755
--- a/gio/gdbus-2.0/codegen/codegen_main.py
+++ b/gio/gdbus-2.0/codegen/codegen_main.py
@@ -166,7 +166,7 @@ def codegen_main():
all_ifaces = []
for fname in args:
- f = open(fname)
+ f = open(fname, 'rb')
xml_data = f.read()
f.close()
parsed_ifaces = parser.parse_dbus_xml(xml_data)