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

与高版本的 certifi 库不兼容 #195

Open
AldousShou opened this issue Jul 23, 2024 · 1 comment
Open

与高版本的 certifi 库不兼容 #195

AldousShou opened this issue Jul 23, 2024 · 1 comment

Comments

@AldousShou
Copy link

环境

  • python:3.10
  • certifi 2024.7.4
  • charset-normalizer 3.3.2
  • idna 3.7
  • pip 24.0
  • requests 2.32.3
  • setuptools 69.5.1
  • urllib3 2.2.2
  • wheel 0.43.0

已经排除的问题

  • 与 requests 库无关

如何复现

  1. 使用 requests 直接下载 attachment 之中的图片、音频等,会出现 SSLError 的错误。并且该错误无法通过 requests.get 之中的 verify=False 屏蔽
  2. 将 requests 库和 certifi 库版本回退后,问题消失

复现代码

import requests

url = r'在这里填充代码'
response = requests.get(url)

if response.status_code == 200:
    with open(r'11111.jpg', 'wb') as f:
        f.write(response.content)
        print('下载成功')
else:
    print(response)
@BB-CHICKEN
Copy link

具体是回退到哪个版本呢,我被这个问题困扰很久了

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