mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
update: optimized code.
This commit is contained in:
parent
5e27ee4bad
commit
22d5094197
1 changed files with 1 additions and 2 deletions
|
|
@ -71,9 +71,8 @@ class InvoiceOCR(Action):
|
|||
# Use CP437 to encode the file name, and then use GBK decoding to prevent Chinese garbled code
|
||||
relative_name = Path(zip_info.filename.encode("cp437").decode("gbk"))
|
||||
if relative_name.suffix:
|
||||
name = relative_name.name
|
||||
full_filename = file_directory / relative_name
|
||||
await File.write(full_filename.parent, name, zip_ref.read(zip_info.filename))
|
||||
await File.write(full_filename.parent, relative_name.name, zip_ref.read(zip_info.filename))
|
||||
|
||||
logger.info(f"unzip_path: {file_directory}")
|
||||
return file_directory
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue