fastdfs python 接口

本文主要讨论了使用Python3的py3Fdfs库与FastDFS交互时遇到的大文件下载错误。在项目中,当尝试下载较大图片时会报错。通过调整代码,已能临时解决该问题,但作者欢迎读者分享更好的解决方案或优化方法。
摘要由CSDN通过智能技术生成

前言:

       fastdfs python提供两个库交互,一个py_client  是python2 的,python3的是py3Fdfs,python2的就不说了,基本上都是python3的,但是用py3Fdfs 这个API的bug蛮多的,这篇就说一个下载的bug吧

这是py3Fdfs下载接口的源码
def download_to_file(self, local_filename, remote_file_id, offset=0, down_bytes=0):
        '''
        Download a file from Storage server.
        arguments:
        @local_filename: string, local name of file 
        @remote_file_id: string, file_id of file that is on storage server
        @offset: long
        @downbytes: long
        @return dict {
            'Remote file_id'  : remote_file_id,
            'Content'         : local_filename,
            'Download size'   : downloaded_size,
            'Storage IP'      : storage_ip
        }
        '''
        tmp = split_remote_fileid(remote_file_id)
        if not tmp:
            raise DataError('[-] Error: remot
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值