diff --git a/Pipfile b/Pipfile index 035b570..d6dec2d 100644 --- a/Pipfile +++ b/Pipfile @@ -21,6 +21,7 @@ six = ">=1.11.0" qiniu = ">=7.1.4,<7.2.4" "urllib3" = ">=1.24.3,<=1.25.3" requests = ">=2.20.0,<=2.22.0" +requests-toolbelt = ">=1.0.0" Werkzeug = ">=0.11.11,<1.0.0" gevent = ">=22.10.2,<23.0.0" typing = { version = "*", markers = "python_version < '3.5.0'" } diff --git a/changelog b/changelog index 9622edb..7539ac0 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,10 @@ -## [3.0.0] - 2022-11-24 +## [3.0.1] - 2024-06-25 + +## Fixed + +- Enable TCP keepalive socket option to fix "Connection reset by peer" problem. https://github.com/psf/requests/issues/4664 + +## [3.0.0] - 2024-04-08 ## Change @@ -37,7 +43,7 @@ ### Fixed - created_at and updated_at were missing on LCFile. -- updated_at was missing on new created LCObject. +- updated_at was missing on new created LCObject. ## [2.9.8] - 2021-12-10 diff --git a/leancloud/client.py b/leancloud/client.py index 6530968..fe9ba1b 100644 --- a/leancloud/client.py +++ b/leancloud/client.py @@ -13,6 +13,7 @@ import six import requests +from requests_toolbelt.adapters.socket_options import TCPKeepAliveAdapter import leancloud from leancloud import utils @@ -43,6 +44,8 @@ app_router = None session = requests.Session() +session.mount("http://", TCPKeepAliveAdapter()) +session.mount("https://", TCPKeepAliveAdapter()) request_hooks = {} SERVER_VERSION = "1.1" diff --git a/requirements.txt b/requirements.txt index 03256cc..023768a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,8 +3,9 @@ arrow>=1.0.0,<2.0.0; python_version >= '3.6' iso8601>=0.1.14 six>=1.11.0 qiniu>=7.3.1 -requests>=2.25.1 -urllib3<2 +requests<=2.31.0 +urllib3<=1.26.18 +requests-toolbelt==1.0.0 Werkzeug>=0.16.0,<2.0.0 secure-cookie>=0.1.0,<1.0.0 gevent>=22.10.2,<23.0.0 diff --git a/setup.py b/setup.py index e926572..129a9e4 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ 'six>=1.11.0', 'qiniu==7.3.1', 'requests>=2.25.1', + 'requests-toolbelt>=1.0.0', 'Werkzeug>=0.16.0,<2.0.0', 'secure-cookie>=0.1.0,<1.0.0', 'gevent>=22.10.2,<23.0.0', @@ -21,7 +22,7 @@ setup( name='leancloud', - version='3.0.0', + version='3.0.1', description='LeanCloud Python SDK', url='https://leancloud.cn/', author='asaka', pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy