Skip to content

Commit b1e2a38

Browse files
sharkfishergibfahn
authored andcommitted
tools: fix cpplint.py when path contains non-ascii
PR-URL: #16047 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 24fd8ff commit b1e2a38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/cpplint.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,8 @@ def RepositoryName(self):
10741074
"""
10751075
fullname = self.FullName()
10761076
# XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory.
1077-
toplevel = os.path.abspath(
1078-
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/')
1077+
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) \
1078+
.replace('\\', '/').decode('utf-8')
10791079
prefix = os.path.commonprefix([fullname, toplevel])
10801080
return fullname[len(prefix) + 1:]
10811081

@@ -6084,7 +6084,7 @@ def main():
60846084

60856085
_cpplint_state.ResetErrorCounts()
60866086
for filename in filenames:
6087-
ProcessFile(filename, _cpplint_state.verbose_level)
6087+
ProcessFile(filename.decode('utf-8'), _cpplint_state.verbose_level)
60886088
_cpplint_state.PrintErrorCounts()
60896089

60906090
sys.exit(_cpplint_state.error_count > 0)

0 commit comments

Comments
 (0)