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:
980
980
"""<link rel="canonical" href="https://docs.python.org/([^"]*)" />"""
981
981
)
982
982
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" )
984
984
canonical = canonical_re .search (html )
985
985
if not canonical :
986
986
continue
987
987
target = canonical .group (1 )
988
988
if not (www_root / target ).exists ():
989
989
logging .info ("Removing broken canonical from %s to %s" , file , target )
990
990
html = html .replace (canonical .group (0 ), "" )
991
- file .write_text (html , encoding = "UTF-8" )
991
+ file .write_text (html , encoding = "UTF-8" , errors = "surrogateescape" )
992
992
993
993
994
994
def main ():
You can’t perform that action at this time.
0 commit comments