"type=file;perm=r;unique==SGP2; file \xAE non-ascii char\r\n")
+def default_error_handler():
+ # bpo-44359: Silently ignore socket errors. Such errors occur when a client
+ # socket is closed, in TestFTPClass.tearDown() and makepasv() tests, and
+ # the server gets an error on its side.
+ pass
+
+
class DummyDTPHandler(asynchat.async_chat):
dtp_conn_closed = False
super(DummyDTPHandler, self).push(what.encode(self.encoding))
def handle_error(self):
- raise Exception
+ default_error_handler()
class DummyFTPHandler(asynchat.async_chat):
self.push('550 command "%s" not understood.' %cmd)
def handle_error(self):
- raise Exception
+ default_error_handler()
def push(self, data):
asynchat.async_chat.push(self, data.encode(self.encoding) + b'\r\n')
return 0
def handle_error(self):
- raise Exception
+ default_error_handler()
if ssl is not None:
raise
def handle_error(self):
- raise Exception
+ default_error_handler()
def close(self):
if (isinstance(self.socket, ssl.SSLSocket) and