Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit580cd5c

Browse files
authored
bpo-30319: socket.close() now ignores ECONNRESET (#2565) (#2566)
socket.close() was modified in Python 3.6 to raise OSError onfailure: seebpo-26685.(cherry picked from commit67e1478)
1 parent23e2c3d commit580cd5c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
socket.close() now ignores ECONNRESET error.

‎Modules/socketmodule.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,9 @@ sock_close(PySocketSockObject *s)
27042704
Py_BEGIN_ALLOW_THREADS
27052705
res=SOCKETCLOSE(fd);
27062706
Py_END_ALLOW_THREADS
2707-
if (res<0) {
2707+
/* bpo-30319: The peer can already have closed the connection.
2708+
Python ignores ECONNRESET on close(). */
2709+
if (res<0&&errno!=ECONNRESET) {
27082710
returns->errorhandler();
27092711
}
27102712
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp