community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1855098 - /comdev/reporter.apache.org/trunk/scripts/prettify.py
Date Sat, 09 Mar 2019 09:43:37 GMT
Author: sebb
Date: Sat Mar  9 09:43:37 2019
New Revision: 1855098

URL: http://svn.apache.org/viewvc?rev=1855098&view=rev
Log:
Also fix decoding for stdin

Modified:
    comdev/reporter.apache.org/trunk/scripts/prettify.py

Modified: comdev/reporter.apache.org/trunk/scripts/prettify.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/prettify.py?rev=1855098&r1=1855097&r2=1855098&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/prettify.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/prettify.py Sat Mar  9 09:43:37 2019
@@ -37,5 +37,8 @@ for arg in args.file:
 
 # No inout files provided
 if len(args.file) == 0:
-    input = json.loads(sys.stdin.read())
+    try:
+        input = json.loads(sys.stdin.buffer.read().decode('UTF-8', errors='replace'))
+    except AttributeError:
+        input = json.loads(sys.stdin.read().decode('UTF-8', errors='replace'))
     json.dump(input, sys.stdout, indent=args.indent, sort_keys=sort_keys)



Mime
View raw message