Bug 1577603 - convert mach clobber to run with python 3.5 r=nalexander
authorEdwin Gao <egao@mozilla.com>
Fri, 30 Aug 2019 17:25:47 +0000
changeset 490900 8ebdab6f0a35d12f7c0b8ceae23e59bdebb41bd8
parent 490899 547093e3a6c75aa023ea5044c439dc1166df232a
child 490901 598fa04e395e32634ccffc97bd7de7dae0497bdc
push id114006
push usermalexandru@mozilla.com
push dateFri, 30 Aug 2019 22:01:27 +0000
treeherdermozilla-inbound@282a30908d52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1577603
milestone70.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 1577603 - convert mach clobber to run with python 3.5 r=nalexander Changes: - remove binary encoding when the subdirectories are being collected - do not open file in binary mode when reading from `telemetry_client_id.json` Differential Revision: https://phabricator.services.mozilla.com/D44057
mach
python/mozbuild/mozbuild/controller/clobber.py
python/mozbuild/mozbuild/telemetry.py
--- a/mach
+++ b/mach
@@ -21,17 +21,16 @@ py2commands="
     browsertime
     build
     build-backend
     buildsymbols
     busted
     cargo
     check-spidermonkey
     clang-format
-    clobber
     compare-locales
     compileflags
     configure
     cppunittest
     cramtest
     crashtest
     devtools-css-db
     doc
--- a/python/mozbuild/mozbuild/controller/clobber.py
+++ b/python/mozbuild/mozbuild/controller/clobber.py
@@ -103,17 +103,17 @@ class Clobberer(object):
             return False
 
     def collect_subdirs(self, root, exclude):
         """Gathers a list of subdirectories excluding specified items."""
         paths = []
         try:
             for p in os.listdir(root):
                 if p not in exclude:
-                    paths.append(os.path.join(root, p).encode('utf-8'))
+                    paths.append(os.path.join(root, p))
         except OSError as e:
             if e.errno != errno.ENOENT:
                 raise
 
         return paths
 
     def delete_dirs(self, root, paths_to_delete):
         """Deletes the given subdirectories in an optimal way."""
--- a/python/mozbuild/mozbuild/telemetry.py
+++ b/python/mozbuild/mozbuild/telemetry.py
@@ -86,17 +86,17 @@ schema = Schema({
 
 def get_client_id(state_dir):
     '''
     Get a client id, which is a UUID, from a file in the state directory. If the file doesn't
     exist, generate a UUID and save it to a file.
     '''
     path = os.path.join(state_dir, 'telemetry_client_id.json')
     if os.path.exists(path):
-        with open(path, 'rb') as f:
+        with open(path, 'r') as f:
             return json.load(f)['client_id']
     import uuid
     # uuid4 is random, other uuid types may include identifiers from the local system.
     client_id = str(uuid.uuid4())
     with open(path, 'wb') as f:
         json.dump({'client_id': client_id}, f)
     return client_id