From 58f3139a4b0d8b5170acc689d0bc0cee0969d7f5 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 24 Jul 2021 01:45:44 -0400 Subject: [PATCH] Get first build passing on mac --- indra/lib/python/indra/util/llmanifest.py | 6 +++--- indra/newview/viewer_manifest.py | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index cc961e268a5..8d07f32d373 100755 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -575,13 +575,13 @@ def replace_in(self, src, dst=None, searchdict={}): if dst == None: dst = src # read src - f = open(self.src_path_of(src), "rbU") + f = open(self.src_path_of(src), "rU") contents = f.read() f.close() # apply dict replacements - for old, new in searchdict.iteritems(): + for old, new in searchdict.items(): contents = contents.replace(old, new) - self.put_in_file(contents, dst) + self.put_in_file(contents.encode("utf-8"), dst) self.created_paths.append(dst) def copy_action(self, src, dst): diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index db0210bf428..126b8a8c69b 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -272,7 +272,7 @@ def icon_path(self): def extract_names(self,src): try: - contrib_file = open(src,'r') + contrib_file = open(src,'rU') except IOError: print("Failed to open '%s'" % src) raise @@ -291,7 +291,7 @@ def extract_names(self,src): names.append(line.rstrip()) # It's not fair to always put the same people at the head of the list random.shuffle(names) - return ', '.join(names) + return ', '.join(names).encode("utf-8") def relsymlinkf(self, src, dst=None, catch=True): """ @@ -658,8 +658,7 @@ def wpath(path): result = "" dest_files = [pair[1] for pair in self.file_list if pair[0] and os.path.isfile(pair[1])] # sort deepest hierarchy first - dest_files.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b)) - dest_files.reverse() + dest_files.sort(key=lambda path: (path.count(os.path.sep), path), reverse=True) out_path = None for pkg_file in dest_files: rel_file = os.path.normpath(pkg_file.replace(self.get_dst_prefix()+os.path.sep,'')) @@ -682,8 +681,7 @@ def wpath(path): for d in deleted_file_dirs: deleted_dirs.extend(path_ancestors(d)) # sort deepest hierarchy first - deleted_dirs.sort(lambda a,b: cmp(a.count(os.path.sep),b.count(os.path.sep)) or cmp(a,b)) - deleted_dirs.reverse() + deleted_dirs.sort(key=lambda path: (path.count(os.path.sep), path), reverse=True) prev = None for d in deleted_dirs: if d != prev: # skip duplicates -- GitLab