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

Method get_boundary

Lib/email/message.py:866–877  ·  view source on GitHub ↗

Return the boundary associated with the payload if present. The boundary is extracted from the Content-Type header's 'boundary' parameter, and it is unquoted.

(self, failobj=None)

Source from the content-addressed store, hash-verified

864 return utils.collapse_rfc2231_value(filename).strip()
865
866 def get_boundary(self, failobj=None):
867 """Return the boundary associated with the payload if present.
868
869 The boundary is extracted from the Content-Type header's 'boundary'
870 parameter, and it is unquoted.
871 """
872 missing = object()
873 boundary = self.get_param('boundary', missing)
874 if boundary is missing:
875 return failobj
876 # RFC 2046 says that boundaries may begin but not end in w/s
877 return utils.collapse_rfc2231_value(boundary).rstrip()
878
879 def set_boundary(self, boundary):
880 """Set the boundary parameter in Content-Type to 'boundary'.

Calls 2

get_paramMethod · 0.95
rstripMethod · 0.45