File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -980,15 +980,15 @@ def proofread_canonicals(www_root: Path) -> None:
980980 """<link rel="canonical" href="https://docs.python.org/([^"]*)" />"""
981981 )
982982 for file in www_root .glob ("**/*.html" ):
983- html = file .read_text (encoding = "UTF-8" )
983+ html = file .read_text (encoding = "UTF-8" , errors = "surrogateescape" )
984984 canonical = canonical_re .search (html )
985985 if not canonical :
986986 continue
987987 target = canonical .group (1 )
988988 if not (www_root / target ).exists ():
989989 logging .info ("Removing broken canonical from %s to %s" , file , target )
990990 html = html .replace (canonical .group (0 ), "" )
991- file .write_text (html , encoding = "UTF-8" )
991+ file .write_text (html , encoding = "UTF-8" , errors = "surrogateescape" )
992992
993993
994994def main ():
You can’t perform that action at this time.
0 commit comments