[Django] #34507: AttributeError: Can't pickle local object 'convert_exception_to_response.<locals>.inner'

11 views
Skip to first unread message

Django

unread,
Apr 21, 2023, 2:36:15 PM4/21/23
to django-...@googlegroups.com
#34507: AttributeError: Can't pickle local object
'convert_exception_to_response.<locals>.inner'
-------------------------------------+-------------------------------------
Reporter: Mateusz | Owner: nobody
Kurowski |
Type: | Status: new
Uncategorized |
Component: | Version: 4.2
Uncategorized | Keywords:
Severity: Normal | pickle,exception,response,test
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
{{{
tblib==1.7.0
django==4.2
}}}


{{{
Error
Traceback (most recent call last):
File "/usr/lib/python3.11/unittest/case.py", line 57, in
testPartExecutor
yield
File "/usr/lib/python3.11/unittest/case.py", line 623, in run
self._callTestMethod(testMethod)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/unittest/case.py", line 579, in
_callTestMethod
if method() is not None:
^^^^^^^^^^^^^^^^^
File ".../tests/test_views.py", line 315, in test_GET
with self.subTest("member can view"):
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/unittest/case.py", line 537, in subTest
with self._outcome.testPartExecutor(self._subtest, subTest=True):
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/contextlib.py", line 155, in __exit__
self.gen.throw(typ, value, traceback)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/unittest/case.py", line 72, in
testPartExecutor
self.result.addSubTest(test_case.test_case, test_case, exc_info)
^^^^^^^^^^^^^^^^^
File "...env/lib/python3.11/site-packages/django/test/runner.py", line
307, in addSubTest
self.check_subtest_picklable(test, subtest)
^^^^^^^^^^^^^^^^^
File "...venv/lib/python3.11/site-packages/django/test/runner.py", line
269, in check_subtest_picklable
self._confirm_picklable(subtest)
^^^^^^^^^^^^^^^^^
File "...venv/lib/python3.11/site-packages/django/test/runner.py", line
186, in _confirm_picklable
pickle.loads(pickle.dumps(obj))
^^^^^^^^^^^^^^^^^
AttributeError: Can't pickle local object
'convert_exception_to_response.<locals>.inner'


}}}

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

Django

unread,
Apr 21, 2023, 3:57:06 PM4/21/23
to django-...@googlegroups.com
#34507: AttributeError: Can't pickle local object
'convert_exception_to_response.<locals>.inner'
-------------------------------------+-------------------------------------
Reporter: Mateusz Kurowski | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
pickle,exception,response,test | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* status: new => closed
* resolution: => needsinfo


Comment:

Hello Mateusz Kurowski, could you please add more details about how to
reproduce this issue? Please refer to
[[https://docs.djangoproject.com/en/dev/internals/contributing/bugs-and-
features/#reporting-bugs|this guide]] about reporting bugs. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/34507#comment:1>

Django

unread,
Apr 22, 2023, 6:16:35 AM4/22/23
to django-...@googlegroups.com
#34507: AttributeError: Can't pickle local object
'convert_exception_to_response.<locals>.inner'
-------------------------------------+-------------------------------------
Reporter: Mateusz Kurowski | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
pickle,exception,response,test | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak):

This may be a duplicate of #32114.

--
Ticket URL: <https://code.djangoproject.com/ticket/34507#comment:2>

Django

unread,
Apr 22, 2023, 9:20:24 AM4/22/23
to django-...@googlegroups.com
#34507: AttributeError: Can't pickle local object
'convert_exception_to_response.<locals>.inner'
-------------------------------------+-------------------------------------
Reporter: Mateusz Kurowski | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.2
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
pickle,exception,response,test | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mateusz Kurowski):

Hey, I apologize for not providing more details earlier. I believe Mariusz
may be correct in saying that this is a duplicate issue. The problem
occurs when I make a request to the view that raises an exception. This
issue only occurs while in a subtest.

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

Django

unread,
Apr 22, 2023, 10:10:33 AM4/22/23
to django-...@googlegroups.com
#34507: AttributeError: Can't pickle local object
'convert_exception_to_response.<locals>.inner'
-------------------------------------+-------------------------------------
Reporter: Mateusz Kurowski | Owner: nobody
Type: Bug | Status: closed
Component: Error reporting | Version: 4.2
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage:
pickle,exception,response,test | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* resolution: needsinfo => duplicate
* component: Uncategorized => Error reporting
* type: Uncategorized => Bug


Comment:

Thanks.

Duplicate of #32114.

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

Reply all
Reply to author
Forward
0 new messages