community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1854918 - /comdev/reporter.apache.org/trunk/scripts/prettify.py
Date Wed, 06 Mar 2019 12:41:14 GMT
Author: sebb
Date: Wed Mar  6 12:41:14 2019
New Revision: 1854918

URL: http://svn.apache.org/viewvc?rev=1854918&view=rev
Log:
Allow for UTF-8 errors

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=1854918&r1=1854917&r2=1854918&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/prettify.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/prettify.py Wed Mar  6 12:41:14 2019
@@ -25,8 +25,8 @@ for arg in args.file:
     print("Reading " + arg)
     input = {}
     try:
-        with open(arg, "r") as f:
-            input = json.loads(f.read())
+        with open(arg, "rb") as f:
+            input = json.loads(f.read().decode('UTF-8', errors='replace'))
         out = arg if args.clobber else arg + ".out"
         print("Writing " + out)
         with open(out, "w") as f:



Mime
View raw message