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

Function parse150

Lib/ftplib.py:792–807  ·  view source on GitHub ↗

Parse the '150' response for a RETR request. Returns the expected transfer size or None; size is not guaranteed to be present in the 150 message.

(resp)

Source from the content-addressed store, hash-verified

790_150_re = None
791
792def parse150(resp):
793 '''Parse the '150' response for a RETR request.
794 Returns the expected transfer size or None; size is not guaranteed to
795 be present in the 150 message.
796 '''
797 if resp[:3] != '150':
798 raise error_reply(resp)
799 global _150_re
800 if _150_re is None:
801 import re
802 _150_re = re.compile(
803 r"150 .* \((\d+) bytes\)", re.IGNORECASE | re.ASCII)
804 m = _150_re.match(resp)
805 if not m:
806 return None
807 return int(m.group(1))
808
809
810_227_re = None

Callers 1

ntransfercmdMethod · 0.85

Calls 4

error_replyClass · 0.85
compileMethod · 0.45
matchMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…