tidevice icon indicating copy to clipboard operation
tidevice copied to clipboard

fix: Requests>=2.32.2 get_connection DEPRECATED

Open BirdLearn opened this issue 1 year ago • 3 comments

在最新的requests 版本中,移除了 get_connection 方法,导致tidevice 启动 wdaproxy 时调用到 get_connection_with_tls_context 方法导致报错 "request error: Not supported URL scheme http+usbmux"

request 相关改动issue: https://github.com/psf/requests/pull/6710

requests 包中详细说明如下 :

    def get_connection(self, url, proxies=None):
        """DEPRECATED: Users should move to `get_connection_with_tls_context`
        for all subclasses of HTTPAdapter using Requests>=2.32.2.

        Returns a urllib3 connection for the given URL. This should not be
        called from user code, and is only exposed for use when subclassing the
        :class:`HTTPAdapter <requests.adapters.HTTPAdapter>`.

        :param url: The URL to connect to.
        :param proxies: (optional) A Requests-style dictionary of proxies used on this request.
        :rtype: urllib3.ConnectionPool
        """
        warnings.warn(
            (
                "`get_connection` has been deprecated in favor of "
                "`get_connection_with_tls_context`. Custom HTTPAdapter subclasses "
                "will need to migrate for Requests>=2.32.2. Please see "
                "https://github.com/psf/requests/pull/6710 for more details."
            ),
            DeprecationWarning,
        )

BirdLearn avatar Jun 17 '24 08:06 BirdLearn

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


lijiazhu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Jun 17 '24 08:06 CLAassistant

  • 难怪, 我频繁报这个错误. 搜索竟然找到了这个 PR.
  • 麻烦作者来看一下.

hhstore avatar Jun 18 '24 19:06 hhstore

官方不能解决下,然后升级吗

tenxun123 avatar Aug 16 '24 09:08 tenxun123

mac中文件的路径 /Users/xxxx/Library/Python/3.9/lib/python/site-packages/tidevice/requests_usbmux.py

chaoyuebaihu avatar Aug 15 '25 12:08 chaoyuebaihu