修复附件名称错误的问题

This commit is contained in:
xunbu
2025-08-28 19:10:04 +08:00
parent 58e9932b29
commit 66f05e309a

View File

@@ -805,7 +805,7 @@ async def _perform_translation(
for identifier, doc in attachment_object.attachment_dict.items(): for identifier, doc in attachment_object.attachment_dict.items():
try: try:
# 'doc' is a Document object # 'doc' is a Document object
attachment_filename = f"{doc.stem or identifier}.{doc.suffix}" attachment_filename = f"{doc.stem or identifier}{doc.suffix}"
attachment_path = os.path.join(temp_dir, attachment_filename) attachment_path = os.path.join(temp_dir, attachment_filename)
with open(attachment_path, "wb") as f: with open(attachment_path, "wb") as f:
f.write(doc.content) f.write(doc.content)