Bug 46209 - Class-based view for handler500 raises SystemCheckError
Summary: Class-based view for handler500 raises SystemCheckError
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: python3-module-django (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-22 16:50 MSK by Anton Zhukharev
Modified: 2025-09-04 10:58 MSK (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Zhukharev 2023-05-22 16:50:40 MSK
System
======

ALT Workstation K 10.1 (updated 22.05.2023)


Package version
===============

python3-module-django-3.2.18-alt1.noarch


Steps to reproduce
==================

1. $ django-admin startproject test

2. $ cd test && python3 manage.py startapp app

3. $ cat >> test/views.py << EOF
from typing import Any

from django.http import HttpRequest, HttpResponse
from django.shortcuts import render
from django.views import View

class PageErrorView(View):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

    def get(self, request):
        return render(request, "errors/500.html", status=500)
EOF

4. $ cat >> test/urls.py << EOF
from .views import PageErrorView
handler500 = PageErrorView.as_view()
EOF

5. $ python3 manage.py runserver


Actual result
=============

$ python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

Exception in thread django-main-thread:
Traceback (most recent call last):
  File "/usr/lib64/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/site-packages/django/utils/autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "/usr/lib/python3/site-packages/django/core/management/commands/runserver.py", line 118, in inner_run
    self.check(display_num_errors=True)
  File "/usr/lib/python3/site-packages/django/core/management/base.py", line 469, in check
    raise SystemCheckError(msg)
django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
?: (urls.E007) The custom handler500 view 'test.views.PageErrorView' does not take the correct number of arguments (request).

System check identified 1 issue (0 silenced).


Expected result
===============

No error.


Extra information
=================

The error happens for handler500 only (other work as expected).
Comment 1 Alexander Makeenkov 2023-06-02 10:49:23 MSK
Воспроизводится в сизифе по шагам из описания.

Версия пакета:
python3-module-django-3.2.19-alt1
Comment 2 Anton Farygin 2025-09-04 10:44:17 MSK
До сих пор  воспроизводится ?
Comment 3 Alexander Makeenkov 2025-09-04 10:58:09 MSK
python3-module-django-5.2.5-alt1 ошибки нет:

```
$ python3 manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).

September 04, 2025 - 07:57:03
Django version 5.2.5, using settings 'test.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
```