Re: [Django] #34482: Unable to access "non-picklable" attributes of empty HttpRequest and HttpResponse objects after shallow copy.

14 views
Skip to first unread message

Django

unread,
Apr 11, 2023, 10:57:46 AM4/11/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
---------------------------------+-----------------------------------------
Reporter: Anvesh Mishra | Owner: Anvesh Mishra
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------

Comment (by Adam Johnson):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 11, 2023, 3:00:50 PM4/11/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
---------------------------------+-----------------------------------------
Reporter: Anvesh Mishra | Owner: Anvesh Mishra
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------
Description changed by Anvesh Mishra:

Old description:

> Trying to access the non-picklable attributes of `HttpRequest` object
> 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'
> }}}

New description:

Trying to access the non-picklable attributes of `HttpRequest` and
`HttpResponse`object 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'
}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:3>

Django

unread,
Apr 11, 2023, 4:52:03 PM4/11/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
---------------------------------+-----------------------------------------
Reporter: Anvesh Mishra | Owner: Anvesh Mishra
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
---------------------------------+-----------------------------------------

Comment (by Anvesh Mishra):

Created the required [https://github.com/django/django/pull/16753 PR]. I
don't know if this patch will work as Adam pointed out various
possibilities that can occur in his
[https://code.djangoproject.com/ticket/34484 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
[https://code.djangoproject.com/ticket/34484#comment:2 Adam Jhonson in
this comment].

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:4>

Django

unread,
Apr 12, 2023, 3:55:10 AM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak

Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: Anvesh Mishra => Mariusz Felisiak


--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:5>

Django

unread,
Apr 12, 2023, 4:05:55 AM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/16755 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:6>

Django

unread,
Apr 12, 2023, 12:52:57 PM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"280ca147af9cdfce1ca9cb14cc3c5527ff6c7a02" 280ca147]:
{{{
#!CommitTicketReference repository=""
revision="280ca147af9cdfce1ca9cb14cc3c5527ff6c7a02"
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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:7>

Django

unread,
Apr 12, 2023, 12:52:57 PM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"173034b00589c083793d495e8b07e35be2cb1cf0" 173034b0]:
{{{
#!CommitTicketReference repository=""
revision="173034b00589c083793d495e8b07e35be2cb1cf0"
Refs #34482 -- Reverted "Fixed #32969 -- Fixed pickling HttpResponse and
subclasses."

This reverts commit d7f5bfd241666c0a76e90208da1e9ef81aec44db.

Thanks Márton Salomváry for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:8>

Django

unread,
Apr 12, 2023, 12:54:31 PM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"791407fef16faa4da6fe2247c24a9055037dd5dd" 791407f]:
{{{
#!CommitTicketReference repository=""
revision="791407fef16faa4da6fe2247c24a9055037dd5dd"
[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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:10>

Django

unread,
Apr 12, 2023, 12:54:31 PM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2feb9333e7044df348c45417d23ee20b08c1a7fd" 2feb933]:
{{{
#!CommitTicketReference repository=""
revision="2feb9333e7044df348c45417d23ee20b08c1a7fd"
[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
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:9>

Django

unread,
Apr 12, 2023, 12:55:22 PM4/12/23
to django-...@googlegroups.com
#34482: Unable to access "non-picklable" attributes of empty HttpRequest and
HttpResponse objects after shallow copy.
-------------------------------------+-------------------------------------
Reporter: Anvesh Mishra | Owner: Mariusz
| Felisiak
Type: Bug | Status: closed

Component: HTTP handling | Version: 4.2
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => fixed


--
Ticket URL: <https://code.djangoproject.com/ticket/34482#comment:11>

Reply all
Reply to author
Forward
0 new messages