Fix datatype and encoding for yum spider
authorMagnus Hagander <magnus@hagander.net>
Sat, 26 Jan 2019 15:45:41 +0000 (16:45 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sat, 26 Jan 2019 15:45:59 +0000 (16:45 +0100)
pgweb/downloads/views.py
tools/ftp/spider_yum.py

index c95f7810177328668fce417c684583628d8e632f..05512876f4eb394518b474fc27bdf37a28948738 100644 (file)
@@ -163,7 +163,7 @@ def uploadyum(request):
         return HttpServerError(request, "Invalid client address")
     # We have the data in request.body. Attempt to load it as
     # json to ensure correct format.
-    json.loads(request.body)
+    json.loads(request.body.decode('utf8'))
 
     # Next, check if it's the same as the current file
     if os.path.isfile(settings.YUM_JSON):
index e969742877a543647d3b551ed858eaccd6b853ad..502eb4b14fb25f74d0c648d177d0b05b5692c675 100755 (executable)
@@ -80,7 +80,7 @@ if __name__ == "__main__":
                         if pinfo['p'] == familypath and pinfo['f'] == shortdist:
                             if p not in reporpms[v]:
                                 reporpms[v][p] = {}
-                            reporpms[v][p][arch] = max(ver, reporpms[v][p].get(arch, 0))
+                            reporpms[v][p][arch] = max(int(ver), int(reporpms[v][p].get(arch, 0)))
                             platforms[p]['found'] = True
                             break
                     else: