MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / parse150

Function parse150

tools/python-3.11.9-amd64/Lib/ftplib.py:814–829  ·  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

812_150_re = None
813
814def parse150(resp):
815 '''Parse the '150' response for a RETR request.
816 Returns the expected transfer size or None; size is not guaranteed to
817 be present in the 150 message.
818 '''
819 if resp[:3] != '150':
820 raise error_reply(resp)
821 global _150_re
822 if _150_re is None:
823 import re
824 _150_re = re.compile(
825 r"150 .* \((\d+) bytes\)", re.IGNORECASE | re.ASCII)
826 m = _150_re.match(resp)
827 if not m:
828 return None
829 return int(m.group(1))
830
831
832_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