MCPcopy Index your code
hub / github.com/python/cpython / abort

Method abort

Lib/ftplib.py:264–276  ·  view source on GitHub ↗

Abort a file transfer. Uses out-of-band data. This does not follow the procedure from the RFC to send Telnet IP and Synch; that doesn't seem to work with the servers I've tried. Instead, just send the ABOR command as OOB data.

(self)

Source from the content-addressed store, hash-verified

262 return resp
263
264 def abort(self):
265 '''Abort a file transfer. Uses out-of-band data.
266 This does not follow the procedure from the RFC to send Telnet
267 IP and Synch; that doesn't seem to work with the servers I've
268 tried. Instead, just send the ABOR command as OOB data.'''
269 line = b'ABOR' + B_CRLF
270 if self.debugging > 1:
271 print('*put urgent*', self.sanitize(line))
272 self.sock.sendall(line, MSG_OOB)
273 resp = self.getmultiline()
274 if resp[:3] not in {'426', '225', '226'}:
275 raise error_proto(resp)
276 return resp
277
278 def sendcmd(self, cmd):
279 '''Send a command and return the response.'''

Callers 7

starttlsMethod · 0.45
_check_byeMethod · 0.45
_commandMethod · 0.45
_command_completeMethod · 0.45
_get_responseMethod · 0.45
_get_lineMethod · 0.45
__enter__Method · 0.45

Calls 4

sanitizeMethod · 0.95
getmultilineMethod · 0.95
error_protoClass · 0.70
sendallMethod · 0.45

Tested by

no test coverage detected