• InsecureRequestWarning: Unverified HTTPS request is being made to host 'xx.xx.cn'. Adding certificate verification is strongly advised.


    使用requests库报下面这个警告
    /Users/xxxance/python_project/code.xxx.org/ad/devops_python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'open.feishu.cn'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
      warnings.warn(
    /Users/xxxance/python_project/code.xxx.org/ad/devops_python/venv/lib/python3.9/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'open.feishu.cn'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
      warnings.warn(
    翻译提示信息后,提示信息表达的意思是:强烈不鼓励发出未经验证的 HTTPS 请求,但是,如果您了解风险并希望禁用这些警告,则可以使用disable_warnings()
    >>> import urllib3
    >>> urllib3.disable_warnings()# 等价于requests.packages.urllib3.disable_warnings()
    或者,您可以使用标准logging模块捕获警告:
    >>> logging.captureWarnings(True)
    最后,您可以通过设置PYTHONWARNINGS环境变量或使用 -W 标志来抑制解释器级别的警告 。
  • 相关阅读:
    Python容器篇 4 -- 字典
    Python容器篇 3 -- 元组
    Python容器篇 2 -- 列表
    Python容器篇 1 -- 字符串
    Python中的关键字
    SQLI-LABS靶场环境搭建详细流程
    Qt QLineEdit 改变text内容的大小
    linux下QT连接mysql找不到驱动
    apt(rpm) Mysql安装
    const 成员函数
  • 原文地址:https://www.cnblogs.com/hi3254014978/p/15717289.html
Copyright © 2020-2023  润新知