Skip to content

Commit

Permalink
Open link-verifier target files with encoding="utf8", errors='ignore'…
Browse files Browse the repository at this point in the history
… options

Print each file name that is processed to stdout.
  • Loading branch information
paulbartell committed Jun 2, 2021
1 parent 9c58cb3 commit c8087ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion link-verifier/verify-links.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ def main():
dirs[:] = [dir for dir in dirs if dir.lower() not in exclude_dirs]
for file in files:
if any(file.endswith(file_type) for file_type in args.include_files):
with open(os.path.join(root, file), 'r') as f:
f_path = os.path.join(root, file)
print("Processing File: {}".format(f_path))
with open(f_path, 'r', encoding="utf8", errors='ignore') as f:
text = f.read()
urls = re.findall(URL_SEARCH_TERM, text)
for url in urls:
Expand Down

0 comments on commit c8087ea

Please sign in to comment.