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 Apr 24, 2024
1 parent 1497b89 commit 237078e
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 237078e

Please sign in to comment.