qiniu / python-sdk

Qiniu Resource (Cloud) Storage SDK for Python
MIT License
546 stars 259 forks source link

如何指定.qiniu_pythonsdk_hostscache.json 文件的路径 #323

Closed huangheLee closed 4 years ago

huangheLee commented 5 years ago

生产环境中很多目录是不允许程序写入,但是似乎该文件只能在运行程序的当前目录生成 这时指定该文件生成的目录就会有必要

swuecho commented 5 years ago

遇到同样的问题。 在 serverless 环境下,可写目录受限。

forrest-mao commented 4 years ago

仅七牛内部员工可见:https://jira.qiniu.io/browse/TS-990

Mei-Zhao commented 4 years ago

新版本v7.2.9支持指定文件路径

yangjunren commented 3 years ago

v7.2.9之后的版本支持自定义.qiniu_pythonsdk_hostscache.json 文件保存路径,.qiniu_pythonsdk_hostscache.json 这个文件只有在上传、fetch、prefetch操作时才会生成。如果您需要手动指定.qiniu_pythonsdk_hostscache.json 保存路径,您可以通过hostscache_dir 参数来指定。 上传相关源码:https://github.com/qiniu/python-sdk/blob/00c1a67f6ecb39bf890be48828fb81cd8264357f/qiniu/services/storage/uploader.py

fetch操作源码:https://github.com/qiniu/python-sdk/blob/00c1a67f6ecb39bf890be48828fb81cd8264357f/qiniu/services/storage/bucket.py#L164

prefetch操作源码:https://github.com/qiniu/python-sdk/blob/00c1a67f6ecb39bf890be48828fb81cd8264357f/qiniu/services/storage/bucket.py#L185