Skip to content

Commit

Permalink
[lint-licenses] Handled errors (#25045)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelianR authored and alexgallotta committed May 9, 2024
1 parent 472de84 commit a0654d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tasks/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ def find_copyright_for(package, overrides, ctx):
for filename in COPYRIGHT_LOCATIONS:
filename = os.path.join(pkgdir, filename)
if os.path.isfile(filename):
for line in open(filename, encoding="utf-8"):
with open(filename, encoding="utf-8", errors="replace") as f:
lines = f.readlines()

for line in lines:
mo = COPYRIGHT_RE.search(line)
if not mo:
continue
Expand Down

0 comments on commit a0654d0

Please sign in to comment.