Bug 1471641 - Python 3 compatibility fixes in mozinstall r=davehunt
authorWilliam Lachance <wlachance@mozilla.com>
Wed, 02 Jan 2019 09:54:09 +0000
changeset 509367 17049f612abe7a62b454add8c110e0993f84e5a6
parent 509366 4ceb73d7896fe04d377b0eb5bd4980302907f569
child 509368 11580728adf0ca32a5bdf0b276385979c535ec0c
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavehunt
bugs1471641
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1471641 - Python 3 compatibility fixes in mozinstall r=davehunt Depends on D15539 Differential Revision: https://phabricator.services.mozilla.com/D15540
testing/mozbase/mozinstall/mozinstall/mozinstall.py
--- a/testing/mozbase/mozinstall/mozinstall/mozinstall.py
+++ b/testing/mozbase/mozinstall/mozinstall/mozinstall.py
@@ -105,18 +105,18 @@ def install(src, dest):
     """
     if not is_installer(src):
         msg = "{} is not a valid installer file".format(src)
         if '://' in src:
             try:
                 return _install_url(src, dest)
             except Exception:
                 exc, val, tb = sys.exc_info()
-                msg = "{} ({})".format(msg, val)
-                reraise(InvalidSource, msg, tb)
+                error = InvalidSource("{} ({})".format(msg, val))
+                reraise(InvalidSource, error, tb)
         raise InvalidSource(msg)
 
     src = os.path.realpath(src)
     dest = os.path.realpath(dest)
 
     did_we_create = False
     if not os.path.exists(dest):
         did_we_create = True
@@ -283,17 +283,17 @@ def _install_dmg(src, dest):
     appDir = None
     try:
         # According to the Apple doc, the hdiutil output is stable and is based on the tab
         # separators
         # Therefor, $3 should give us the mounted path
         appDir = subprocess.check_output('hdiutil attach -nobrowse -noautoopen "%s"'
                                          '|grep /Volumes/'
                                          '|awk \'BEGIN{FS="\t"} {print $3}\'' % str(src),
-                                         shell=True).strip()
+                                         shell=True).strip().decode('ascii')
 
         for appFile in os.listdir(appDir):
             if appFile.endswith('.app'):
                 appName = appFile
                 break
 
         mounted_path = os.path.join(appDir, appName)