Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: this relates to #14336, fixes the 'make lint' portion with non-ascii build file path #16047

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ def RepositoryName(self):
"""
fullname = self.FullName()
# XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory.
toplevel = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/')
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) \
.replace('\\', '/').decode('utf-8')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a little easier to read as:

toplevel = os.path.abspath(...)
toplevel = toplevel.decode('utf-8')

prefix = os.path.commonprefix([fullname, toplevel])
return fullname[len(prefix) + 1:]

Expand Down Expand Up @@ -6084,7 +6084,7 @@ def main():

_cpplint_state.ResetErrorCounts()
for filename in filenames:
ProcessFile(filename, _cpplint_state.verbose_level)
ProcessFile(filename.decode('utf-8'), _cpplint_state.verbose_level)
_cpplint_state.PrintErrorCounts()

sys.exit(_cpplint_state.error_count > 0)
Expand Down