Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

错误提示 #1

Closed
MeowCold opened this issue Aug 20, 2017 · 10 comments
Closed

错误提示 #1

MeowCold opened this issue Aug 20, 2017 · 10 comments

Comments

@MeowCold
Copy link

XXX@PC:~$ qiniu -l backup
Traceback (most recent call last):
File "/usr/local/bin/qiniu", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/qiniuManager/run.py", line 138, in main
qiniu.list(arg[1])
File "/usr/local/lib/python2.7/dist-packages/qiniuManager/manager.py", line 40, in auth_ok
return function(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/qiniuManager/manager.py", line 322, in list
state, data = self.__get_list_in_space(space, is_debug=is_debug)
File "/usr/local/lib/python2.7/dist-packages/qiniuManager/manager.py", line 363, in __get_list_in_space
headers={'Authorization': 'QBox {}'.format(self.auth.token_of_request(url))})
File "/usr/local/lib/python2.7/dist-packages/qiniuManager/http.py", line 144, in request
self.https_init(host, port)
File "/usr/local/lib/python2.7/dist-packages/qiniuManager/http.py", line 106, in https_init
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
AttributeError: 'module' object has no attribute 'SSLContext'

@hellflame
Copy link
Owner

额,是不是python的版本低于 2.7.9 ?

ssl 'module' object has no attribute 'SSLContext'

@MeowCold
Copy link
Author

发现确实低了 是2.7.6 我去升级

@hellflame
Copy link
Owner

我按照链接里面的说法,试着改一下

ssl.create_default_context() 代替 ssl.SSLContext(ssl.PROTOCOL_TLSv1)

@MeowCold
Copy link
Author

问个小白问题怎么更新?

@hellflame
Copy link
Owner

image

第一个应该就可以了

@MeowCold
Copy link
Author

嗯 我试了 最高1.3.2
对了,问下生成的私有空间链接在浏览器可以正常下载但使用 ssh
示例
root@PC:~# wget http://backup.ybyys.com/qinkup.zip?e=15032416&token=8s2byGum7LQhkPEZSQ54-KdqLLKYK4b:k1-2yACgnrDqPlk-uCdEBbY=

最终总是报错为
已发出 HTTP 请求,正在等待回应... 401 Unauthorized

用户名/密码认证失败。

@hellflame
Copy link
Owner

额,,这里需要的不是用户名和密码验证的吧=。=

image

是按照上面的方法设置密钥的么

@hellflame
Copy link
Owner

hellflame commented Aug 20, 2017

浏览器访问结果是

{"error":"download token auth failed"}

如果是wget的问题的话,可能需要这样

wget --content-disposition "http://backup.ybyys.com/qinkup.zip?e=15032416&token=8s2byGum7LQhkPEZSQ54-KdqLLKYK4b:k1-2yACgnrDqPlk-uCdEBbY="

或者用提供的命令:

qiniu -d qinkup.zip

仔细看看 README 应该会有很大帮助

@MeowCold
Copy link
Author

MeowCold commented Aug 21, 2017

感谢 用你提供的wget方法可以下载了。
之前遇到的问题是微软子系统ubuntu无法正常升级py之后我换成虚拟机使用ubuntu正常了。
我提问里的示例是删掉了部分密钥的,因为怕被人检索到。之前看到有人专门检索github用户账号密码以及s3相关地址
感谢您能挤出时间给予我帮助,祝颂商祺

@hellflame
Copy link
Owner

hellflame commented Aug 21, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants