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

python3.12 support #520

Open
Jassy930 opened this issue Oct 23, 2023 · 6 comments
Open

python3.12 support #520

Jassy930 opened this issue Oct 23, 2023 · 6 comments

Comments

@Jassy930
Copy link

  • Python Version: 3.12
  • aliyunsdkcore Version: 2.14.0
  • API: osssdk 中的 get_bucket()

python更新到3.12后,删除了ssl.wrap_socket() 改为 ssl.SSLContext.wrap_socket https://docs.python.org/3/whatsnew/3.12.html#ssl

导致 site-packages/aliyunsdkcore/vendored/requests/packages/urllib3/util/ssl_.py line 46 中导入PROTOCOL_SSLv23失败

@ShaMaTeYing
Copy link

有解决方案了吗?

@Jassy930
Copy link
Author

有解决方案了吗?

我是本地改了代码,把 import 换成了 wrap_socket = ssl.SSLContext.wrap_socket

@houzhiqiang
Copy link

我去阿里云提个工单问问

@houzhiqiang
Copy link

https://docs.python.org/zh-cn/3.11/library/ssl.html#ssl.wrap_socket
python3.2开始不推荐使用的方法,3.7开始弃用警告的方法留到现在...

@houzhiqiang
Copy link

原来是把urllib3的代码直接拷贝进来的啊

@Jassy930
Copy link
Author

原来是把urllib3的代码直接拷贝进来的啊

是,很多库也都这么干为了版本稳定,也可以考虑自己把新版本的库源码copy进来

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

3 participants