Martin Panter added the comment:

Making this an index of related reports:

Issue 30319: test_imap
Issue 30315: test_ftplib
Issue 30543: test_timeout
Issue 30328: test_ssl
Issue 27784: test_asyncore.TestAPI_UseIPv6Select.test_handle_accept, 
test_socketserver
Issue 30106: test_asyncore.TestAPI_UseIPv6Poll.test_handle_write

These all look like a side effect of my change to raise an error from the OS as 
an exception when closing a socket, Issue 26685. Only 3.6+ is affected. 
According to <https://www.freebsd.org/cgi/man.cgi?close%282%29>, ECONNRESET 
means “The underlying object was a stream socket that was shut down by the peer 
before all pending data was delivered”.

It seems this is specific to Free BSD. See bug report about Posix compliance: 
<https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=159179>. According to 
<https://forums.zeroc.com/discussion/5569/patch-to-network-cpp-for-freebsd-for-econnreset-on-close-2-problem>
 this started in Free BSD 6.3 in 2006.

I suppose the options are:

1. Completely revert Issue 26685 and ignore all “socket.close” errors (my least 
preferred option)
2. Ignore ECONNRESET in “socket.close” (backwards compatible, could use 
“os.close” if you really want to check for ECONNRESET)
3. Ignore ECONNRESET in the various higher-level libraries
4. Adjust the tests to ignore the error or otherwise avoid the problem

----------
dependencies: +Random failure of test_TCPServer() of 
test.test_socketserver.SocketServerTest and test_handle_accept() of 
test.test_asyncore.TestAPI_UseIPv6Select on FreeBSD buildbots, test_asyncore: 
test_handle_write() fails in tearDown(), test_ftplib.TestTLS_FTPClass: "[Errno 
54] Connection reset by peer" on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot, 
test_ssl.test_connect_with_context(): ConnectionResetError on AMD64 FreeBSD 9.x 
3.6, test_timeout fails on AMD64 FreeBSD CURRENT Debug 3.x: 
ConnectionResetError: [Errno 54] Connection reset by peer
keywords: +3.6regression
nosy: +martin.panter
title: test_invalid_authentication()  of test_imaplib: ConnectionResetError: 
[Errno 54] Connection reset by peer in shutdown() on AMD64 FreeBSD 9.x 3.6 -> 
ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on 
FreeBSD, Py 3.6
type:  -> behavior

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to