Opened 4 years ago

Closed 4 years ago

#16178 closed Cleanup/optimization (fixed)

Cleanup request classes' __repr__()

Reported by: julien Owned by: nobody
Component: HTTP handling Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


As discussed in, there are a few small inconsistencies and some duplicated code in HttpRequest's, ModPythonRequest's, and WSGIRequest's __repr__() methods, and since [16339] also in ExceptionReporterFilter.get_request_repr (). The attached patch consolidates all that code into a single function. Note that I had to initialise the _post_parse_error attribute in the HttpRequest constructor, which should make sense since that attribute is used in some of HttpRequest's methods anyway.

Attachments (1)

16178.request_repr.diff (11.4 KB) - added by julien 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by julien

comment:1 Changed 4 years ago by nnrcschmdt

  • Triage Stage changed from Unreviewed to Accepted

Patch looks good, it applies without problem. The tests pass.

comment:2 Changed 4 years ago by ramiro

  • Triage Stage changed from Accepted to Ready for checkin

Any patch that removes ~40 lines of code from the core and adds the same amount of them to the test is RFC in my book :)

comment:3 Changed 4 years ago by lukeplant

See also #12098

comment:4 Changed 4 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from new to closed

In [16350]:

Fixed #16178 - Cleanup request classes' __repr__()

Thanks to julien for the patch.

Note: See TracTickets for help on using tickets.
Back to Top