From 71528b8660fe59dc84d32ca37f3fdb54d4e00be8 Mon Sep 17 00:00:00 2001 From: Daniel Furtlehner Date: Tue, 28 Aug 2018 17:00:54 +0200 Subject: [PATCH] AddonManager: Fixes download of metadata.txt with Py3 urllib2 in Py3 gives us a bytearray instead of a string. We have to decode it first to get the metadata.txt. When decoding fails we assume that we are in Py2 and process as before. --- src/Mod/AddonManager/AddonManager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/AddonManager/AddonManager.py b/src/Mod/AddonManager/AddonManager.py index 275fb9b708..739606f9e4 100644 --- a/src/Mod/AddonManager/AddonManager.py +++ b/src/Mod/AddonManager/AddonManager.py @@ -1003,6 +1003,13 @@ class InstallWorker(QtCore.QThread): # metadata.txt found depsfile = mu.read() mu.close() + + # urllib2 gives us a bytelike object instead of a string. Have to consider that + try: + depsfile = depsfile.decode('utf-8') + except AttributeError: + pass + deps = depsfile.split("\n") for l in deps: if l.startswith("workbenches="):