Skip to content

Commit

Permalink
scrips: update the update copyright script so it's compatible with wi…
Browse files Browse the repository at this point in the history
…ndows
  • Loading branch information
Legorooj committed Jan 6, 2021
1 parent c51d203 commit bb60469
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/update-copyright
Expand Up @@ -98,7 +98,7 @@ def get_file_list():

text = subprocess.check_output(
'git ls-tree -rz --name-only --full-tree HEAD | '
'xargs -0 git check-attr text -z', shell=True)
'git check-attr text -z --stdin', shell=True)
text = text.rstrip(b'\0') # strip trailing NULL-byte
for entry in chunks(text.split(b'\0'), 3):
assert len(entry) == 3, entry
Expand Down Expand Up @@ -172,7 +172,7 @@ missing_copyright = []
files = get_file_list()

for filename in files:
with open(filename, 'r') as f:
with open(filename, 'r', encoding='utf-8') as f:
try:
text = f.read()
except UnicodeDecodeError as e:
Expand All @@ -181,7 +181,7 @@ for filename in files:
#newtext = replace_header_content(text)
if newtext:
pass
with open(filename, 'w') as f:
with open(filename, 'w', encoding='utf-8') as f:
f.write(newtext)
elif ignore(filename):
continue
Expand Down

0 comments on commit bb60469

Please sign in to comment.