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

Function parse257

Lib/ftplib.py:852–871  ·  view source on GitHub ↗

Parse the '257' response for a MKD or PWD request. This is a response to a MKD or PWD request: a directory name. Returns the directoryname in the 257 reply.

(resp)

Source from the content-addressed store, hash-verified

850
851
852def parse257(resp):
853 '''Parse the '257' response for a MKD or PWD request.
854 This is a response to a MKD or PWD request: a directory name.
855 Returns the directoryname in the 257 reply.'''
856 if resp[:3] != '257':
857 raise error_reply(resp)
858 if resp[3:5] != ' "':
859 return '' # Not compliant to RFC 959, but UNIX ftpd does this
860 dirname = ''
861 i = 5
862 n = len(resp)
863 while i < n:
864 c = resp[i]
865 i = i+1
866 if c == '"':
867 if i >= n or resp[i] != '"':
868 break
869 i = i+1
870 dirname = dirname + c
871 return dirname
872
873
874def print_line(line):

Callers 2

mkdMethod · 0.85
pwdMethod · 0.85

Calls 1

error_replyClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…