@@ -36,7 +36,7 @@ def update_file_exclude_patterns():
3636 folder_exclude_patterns = s .get ('extra_folder_exclude_patterns' , [])
3737 for path in all_ignored_paths ():
3838 if os .path .isdir (path ):
39- folder_exclude_patterns .append (path .rstrip ('/' ))
39+ folder_exclude_patterns .append (path .rstrip (u '/' ))
4040 else :
4141 file_exclude_patterns .append (path )
4242
@@ -120,7 +120,7 @@ def parent_repo_path(folder):
120120 ['git' , 'rev-parse' , '--show-toplevel' ],
121121 stdout = subprocess .PIPE ,
122122 cwd = folder
123- ).stdout .read ().strip ()
123+ ).stdout .read ().decode ( 'utf-8' , 'ignore' ). strip ()
124124
125125def find_git_repos (folder ):
126126 """
@@ -134,12 +134,14 @@ def find_git_repos(folder):
134134 stdout = subprocess .PIPE
135135 ).stdout .read ()
136136
137- if command_output .isspace () or command_output == '' :
137+ command_output = command_output .decode ('utf-8' , 'ignore' )
138+
139+ if command_output .isspace () or command_output == u'' :
138140 return []
139141
140- dot_git_folders = command_output .strip ().split ('\n ' )
142+ dot_git_folders = command_output .strip ().split (u '\n ' )
141143
142- return [path .replace ('/.git' , '' ) for path in dot_git_folders ]
144+ return [path .replace (u '/.git' , u '' ) for path in dot_git_folders ]
143145
144146def repo_ignored_paths (git_repo ):
145147 """
@@ -155,15 +157,17 @@ def repo_ignored_paths(git_repo):
155157 cwd = git_repo
156158 ).stdout .read ()
157159
158- if command_output .isspace () or command_output == '' :
159- return []
160+ command_output = command_output .decode ('utf-8' , 'ignore' )
161+
162+ if command_output .isspace () or command_output == u'' :
163+ return []
160164
161- lines = command_output .strip ().split ('\n ' )
165+ lines = command_output .strip ().split (u '\n ' )
162166 # Each line in `lines` now looks something like:
163167 # "Would remove foo/bar/yourfile.txt"
164168
165- relative_paths = [line .replace ('Would remove ' , '' , 1 ) for line in lines ]
166- absolute_paths = [git_repo + '/' + path for path in relative_paths ]
169+ relative_paths = [line .replace (u 'Would remove ' , u '' , 1 ) for line in lines ]
170+ absolute_paths = [git_repo + u '/' + path for path in relative_paths ]
167171
168172 return absolute_paths
169173
0 commit comments