Skip to content

临时文件名过长报错 #317

@fanjiajie

Description

@fanjiajie

tmp_file_name = "{file_name}_{uuid}".format(file_name=file_name, uuid=uuid.uuid4().hex)

因为加了_{uuid},使得原本的文件名又增加了33个字符。with open(tmp_file_name, 'wb')的时候就有可能报:OSError: [Errno 36] File name too long:

建议直接使用uuid当作文件?

虽然通过改download_file的入参DisableTempDestFilePath=True修复了我们的bug。但是DisableTempDestFilePath默认值是False,一般开发不会去改,都用默认的,直到出现问题才会看到这个参数

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions