Win7 64-bit
Python 3.5.3
I discovered this when using UEditor combined with Qiniu SDK to upload pictures
Traceback (most recent call last):
...
File "D:\Python\python34\lib\site-packages\qiniu\zone.py", line 124, in host_cache_file_path
return home + "/.qiniu_pythonsdk_hostscache.json"
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
The reason is that the system environment variable is not set to HOME
def host_cache_file_path(self):
home = os.getenv("HOME")
return home + "/.qiniu_pythonsdk_hostscache.json"
I would like to ask if this is a BUG of Qiniu, or is it not compatible enough with Python 3.x?
为情所困2017-05-18 11:03:10
The problem is with your code. The result of os.getenv("HOME") is still None, and the environment variable is still not passed!
phpcn_u15822017-05-18 11:03:10
I took a look on GitHub, and the official code has been updated.