@@ -217,7 +217,8 @@ def query_params(self):
217217 @property
218218 def data (self ):
219219 if not _hasattr (self , '_full_data' ):
220- self ._load_data_and_files ()
220+ with wrap_attributeerrors ():
221+ self ._load_data_and_files ()
221222 return self ._full_data
222223
223224 @property
@@ -420,13 +421,14 @@ def __getattr__(self, attr):
420421 _request = self .__getattribute__ ("_request" )
421422 return getattr (_request , attr )
422423 except AttributeError :
423- return self .__getattribute__ ( attr )
424+ raise AttributeError ( f"' { self .__class__ . __name__ } ' object has no attribute ' { attr } '" )
424425
425426 @property
426427 def POST (self ):
427428 # Ensure that request.POST uses our request parsing.
428429 if not _hasattr (self , '_data' ):
429- self ._load_data_and_files ()
430+ with wrap_attributeerrors ():
431+ self ._load_data_and_files ()
430432 if is_form_media_type (self .content_type ):
431433 return self ._data
432434 return QueryDict ('' , encoding = self ._request ._encoding )
@@ -437,7 +439,8 @@ def FILES(self):
437439 # Different from the other two cases, which are not valid property
438440 # names on the WSGIRequest class.
439441 if not _hasattr (self , '_files' ):
440- self ._load_data_and_files ()
442+ with wrap_attributeerrors ():
443+ self ._load_data_and_files ()
441444 return self ._files
442445
443446 def force_plaintext_errors (self , value ):
0 commit comments