abspath和join不能与PYTHONHTTPSVERIFY=0一起使用

2024-03-28 22:32:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试加入一个带有abspathos的文件路径,但在此之前,我将PYTHONHTTPSVERIFY=0设置为禁用SSL证书验证,但是abspath现在对我不起作用。 我的代码是``filepath=abspath(join(“config”,config\u file))

我得到的错误是

    def join(a, *p):
        """Join two or more pathname components, inserting '/' as needed.
        If any component is an absolute path, all previous path components
        will be discarded.  An empty last part will result in a path that
        ends with a separator."""
        sep = _get_sep(a)
        path = a
        try:
            for b in p:
>               if b.startswith(sep):
E               AttributeError: 'function' object has no attribute 'startswith'

/apps/android/python-3.4.4-x64/lib/python3.4/posixpath.py:79: AttributeError

此代码在没有PYTHONHTTPSVERIFY=0的情况下工作,但我需要禁用此SSL证书验证。是否有其他方法禁用SSL证书验证。你知道吗

这是SSL证书验证的错误。你知道吗

<results status="failed" reason="[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)" errno="13001"></results>


Tags: path代码inconfigssl错误componentswill