You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2019/03/06 12:41:14 UTC
svn commit: r1854918 - /comdev/reporter.apache.org/trunk/scripts/prettify.py
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: