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

requests.exceptions.ConnectionError #20

Open
kylin-2022y opened this issue Dec 28, 2022 · 0 comments
Open

requests.exceptions.ConnectionError #20

kylin-2022y opened this issue Dec 28, 2022 · 0 comments

Comments

@kylin-2022y
Copy link

在提交前,请确保您已经检查了以下内容!

[ x ] 您可以在浏览器中登陆微信账号,但不能使用itchat登陆

[ x ] 我已经阅读并按文档 中的指引进行了操作

[ x ] 您的问题没有在issues报告,否则请在原有issue下报告

[ x ] 本问题确实关于itchat, 而不是其他项目.

[ x ] 如果你的问题关于稳定性,建议尝试对网络稳定性要求极低的itchatmp项目

请使用itchat.run(debug=True)运行,并将输出粘贴在下面:

Traceback (most recent call last):
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
    resp = conn.urlopen(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    retries = retries.increment(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
    httplib_response = self._make_request(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
    self._validate_conn(conn)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
    conn.connect()
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
    self.sock = ssl_wrap_socket(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/ssl.py", line 513, in wrap_socket
    return self.sslsocket_class._create(
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/ssl.py", line 1071, in _create
    self.do_handshake()
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/ssl.py", line 1342, in do_handshake
    self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/itchat/utils.py", line 134, in test_connect
    r = requests.get(config.BASE_URL)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "/home/V01/extittivns03/.pyenv/versions/3.10.8/lib/python3.10/site-packages/requests/adapters.py", line 547, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

You can't get access to internet or wechat domain, so exit.

Process finished with exit code 0

您的itchat版本为:[1.5.0.dev]。(可通过python -c "import itchat;print(itchat.__version__)"获取)

操作系统版本: Ubantu 20.04 tls

其他的内容或者问题更详细的描述都可以添加在下面:

代码:

import itchat
from itchat.content import TEXT


@itchat.msg_register(TEXT)
def text_reply(msg):
    return msg.text


itchat.auto_login(enableCmdQR=2)
itchat.run(True)
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

1 participant