From d7f3bfa681d630c0fe2ac456fd2a0def3816916d Mon Sep 17 00:00:00 2001 From: southfox Date: Wed, 19 Jun 2024 05:14:43 +0200 Subject: [PATCH] [fix] ensure bs4 write back normal --- soup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soup.py b/soup.py index 05bc68a..0413a94 100644 --- a/soup.py +++ b/soup.py @@ -218,7 +218,7 @@ def write_backlinks(backlinks_dict): parse_node_backlink(i) - with open(backlinks_dict[page]["path"], 'r+') as f: + with open(backlinks_dict[page]["path"], "w", encoding="utf-8") as f: f.write(str(soup)) print("write " + page + '!')