This is an automated email from the ASF dual-hosted git repository.

magicaltrout pushed a commit to branch python3
in repository https://gitbox.apache.org/repos/asf/drat.git


The following commit(s) were added to refs/heads/python3 by this push:
     new 725a386  update issues in the partitioner
725a386 is described below

commit 725a38655e5334fe074ed8729a021c14ba2d8f66
Author: Tom Barber <[email protected]>
AuthorDate: Tue Mar 5 23:50:00 2019 +0000

    update issues in the partitioner
---
 .../main/resources/bin/mime_partitioner/mime_rat_partitioner.py   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/pge/src/main/resources/bin/mime_partitioner/mime_rat_partitioner.py 
b/pge/src/main/resources/bin/mime_partitioner/mime_rat_partitioner.py
index c6cd1ff..335b567 100755
--- a/pge/src/main/resources/bin/mime_partitioner/mime_rat_partitioner.py
+++ b/pge/src/main/resources/bin/mime_partitioner/mime_rat_partitioner.py
@@ -27,7 +27,7 @@ import json
 import getopt
 import urllib
 from urllib.request import urlopen, Request
-import xmlrpc
+from xmlrpc import client
 
 #urllib.request.build_opener(urllib.HTTPHandler(debuglevel=1))
 solrPostfix = 
"/select/?q=mimetype:$type&version=2.2&start=0&rows=10&indent=on&facet=on&facet.field=mimetype&wt=json&fl=filelocation,filename"
@@ -47,21 +47,21 @@ def executeRatJobs(url, num, type, workflowUrl, taskIds):
     req = Request(solrUrl)
     try:
         f = urlopen(req)
-        jsonResp = json.loads(f.read())
+        jsonResp = json.loads(f.read().decode('utf-8'))
         numFound = int(jsonResp["response"]["numFound"])
     except urllib.error.HTTPError as err:
         print("HTTP error(%s)" % (err))
         print("Aborting RAT execution")
         return
 
-    wm = xmlrpc.client.Server(workflowUrl)
+    wm = client.Server(workflowUrl)
 
 
     for i in range(0, numFound, num):
         ratSolrUrl = url + solrPostfixByPage.replace("$type", 
type).replace("$i", str(i)).replace("$num",str(num))
         req = Request(ratSolrUrl)
         f = urlopen(req)
-        jsonResp = json.loads(f.read())
+        jsonResp = json.loads(f.read().decode('utf-8'))
         docs = jsonResp["response"]["docs"]
         metadata = {}
         metadata["MimeType"] = type

Reply via email to