修复附件名称错误的问题
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user