#34482 closed Bug (fixed)

Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy.

Reported by: Anvesh Mishra Owned by: Mariusz Felisiak
Component: HTTP handling Version: 4.2
Severity: Release blocker Keywords:
Cc: Mariusz Felisiak Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Anvesh Mishra)

Trying to access the non-picklable attributes of HttpRequest and HttpResponseobject after shallow copy leads to an AttributeError.
Example:

request = HttpRequest()
request_copy = copy(request)
match = request_copy.resolver_match

AttributeError: 'WSGIRequest' object has no attribute 'resolver_match'

Change History (11)

comment:1 by Mariusz Felisiak, 20 months ago

Severity: NormalRelease blocker
Summary: Unable to access non-picklable attributes of HttpRequest and HttpResponse objects after shallow copy.Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy.
Triage Stage: UnreviewedAccepted

Regressions in d7f5bfd241666c0a76e90208da1e9ef81aec44db and 6220c445c40a6a7f4d442de8bde2628346153963.

Thanks Márton Salomváry for the report.

comment:2 by Adam Johnson, 20 months ago

I opened #34484 for a report due to a related failure caused by the same patch.

comment:3 by Anvesh Mishra, 20 months ago

Description: modified (diff)

comment:4 by Anvesh Mishra, 20 months ago

Created the required PR. I don't know if this patch will work as Adam pointed out various possibilities that can occur in his comments on this ticket.
Didn't add the regression tests yet due to the regressions added in d7f5bfd241666c0a76e90208da1e9ef81aec44db and 6220c445c40a6a7f4d442de8bde2628346153963. Maybe we could add regressions for WSGIRequest and ASGIRequest as pointed out by Adam Jhonson in this comment.

comment:5 by Mariusz Felisiak, 20 months ago

Owner: changed from Anvesh Mishra to Mariusz Felisiak

comment:6 by Mariusz Felisiak, 20 months ago

Has patch: set

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 20 months ago

In 280ca147:

Fixed #34484, Refs #34482 -- Reverted "Fixed #29186 -- Fixed pickling HttpRequest and subclasses."

This reverts commit 6220c445c40a6a7f4d442de8bde2628346153963.

Thanks Adam Johnson and Márton Salomváry for reports.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 20 months ago

In 173034b0:

Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and subclasses."

This reverts commit d7f5bfd241666c0a76e90208da1e9ef81aec44db.

Thanks Márton Salomváry for the report.

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 20 months ago

In 2feb933:

[4.2.x] Fixed #34484, Refs #34482 -- Reverted "Fixed #29186 -- Fixed pickling HttpRequest and subclasses."

This reverts commit 6220c445c40a6a7f4d442de8bde2628346153963.

Thanks Adam Johnson and Márton Salomváry for reports.

Backport of 280ca147af9cdfce1ca9cb14cc3c5527ff6c7a02 from main

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 20 months ago

In 791407f:

[4.2.x] Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and subclasses."

This reverts commit d7f5bfd241666c0a76e90208da1e9ef81aec44db.

Thanks Márton Salomváry for the report.

Backport of 173034b00589c083793d495e8b07e35be2cb1cf0 from main

comment:11 by Mariusz Felisiak, 20 months ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top