[gobject-introspection] Use binary mode buffer for stdout
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] Use binary mode buffer for stdout
- Date: Wed, 2 Feb 2022 19:05:09 +0000 (UTC)
commit cbe75d5445b26f4ac877d1324e4d50933091cbd9
Author: Hu Jialun <hujialun outlook sg>
Date: Fri Jan 21 18:39:39 2022 +0000
Use binary mode buffer for stdout
By default, stdout is in text mode, expecting a str rather than byte.
Change the output destination to the underlying binary buffer to write bytes.
giscanner/scannermain.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 957ba0b7..1124bc74 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -471,7 +471,7 @@ def create_source_scanner(options, args):
def write_output(data, options):
"""Write encoded XML 'data' to the filename specified in 'options'."""
if options.output == "-":
- output = sys.stdout
+ output = sys.stdout.buffer
try:
output.write(data)
except IOError as e:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]