MCPcopy
hub / github.com/django/django / parse

Method parse

django/http/multipartparser.py:117–131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 self._upload_handlers = upload_handlers
116
117 def parse(self):
118 # Call the actual parse routine and close all open files in case of
119 # errors. This is needed because if exceptions are thrown the
120 # MultiPartParser will not be garbage collected immediately and
121 # resources would be kept alive. This is only needed for errors because
122 # the Request object closes all uploaded files at the end of the
123 # request.
124 try:
125 return self._parse()
126 except Exception:
127 if hasattr(self, "_files"):
128 for _, files in self._files.lists():
129 for fileobj in files:
130 fileobj.close()
131 raise
132
133 def _parse(self):
134 """

Callers 1

parse_file_uploadMethod · 0.45

Calls 3

_parseMethod · 0.95
listsMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected