fix module chinese. 另外,最低1元起

This commit is contained in:
Ivan Office
2023-08-25 00:22:45 +08:00
parent d13d38a302
commit c649d08360
5 changed files with 421 additions and 6 deletions

View File

@@ -21,7 +21,8 @@ class Module(models.Model):
else:
module.description_html_cn = False
if module_path and path:
with tools.file_open(path, 'rb') as desc_file:
# 注意: b 不能在 mode中才能使用 utf-8
with tools.file_open(path, 'r') as desc_file:
doc = desc_file.read()
html = lxml.html.document_fromstring(doc)
for element, attribute, link, pos in html.iterlinks():