{{{
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in
inner
34. response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in
_get_response
115. response = self.process_exception_by_middleware(e,
request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in
_get_response
113. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/django/contrib/syndication/views.py"
in __call__
39. feedgen = self.get_feed(obj, request)
File "/usr/lib/python3/dist-packages/django/contrib/syndication/views.py"
in get_feed
127. current_site = get_current_site(request)
File "/usr/lib/python3/dist-packages/django/contrib/sites/shortcuts.py" in
get_current_site
15. from .requests import RequestSite
Exception Type: ImportError at /pkg/gdb/rss
Exception Value: cannot import name 'RequestSite' from partially
initialized module 'django.contrib.sites.requests' (most likely due to a
circular import)
(/usr/lib/python3/dist-packages/django/contrib/sites/requests.py)
}}}
Note that in the Django configuration, I do not enable the
django.contrib.sites application. This seems to be in line with the
django.contrib.syndication doc saying that if you don't have the
django.contrib.sites application you get a RequestSite object instead.
FWIW the view is here: https://salsa.debian.org/qa/distro-
tracker/-/blob/master/distro_tracker/core/news_feed.py#L37
And this is about https://tracker.debian.org
This is reproduced with Django 2.2.25 (Debian package python3-django
2:2.2.25-1~deb11u1) and I know it's relatively old. But I find it weird
that this problem started to appear recently (or at least get more
frequent) since the website has been upgraded to run on Debian 11 instead
of Debian 10 (the Django major version has not changed, but the Python
version went to 3.9 and the dependencies have been upgraded too). Or it
might be related to some recent updates within 2.2.x but that seems
unlikely since it's only security updates at this point.
As a wild guess, the underlying reason is more likely to be related to
changes in Python 3.9 import logic.
--
Ticket URL: <https://code.djangoproject.com/ticket/33420>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* type: Uncategorized => Bug
* resolution: => fixed
Comment:
Thanks for the report. This should be already fixed by
78163d1ac4407d59bfc5fdf1f84f2dbbb2ed3443 on the current `main` branch.
Unfortunately, we don't know how to reproduce this at will, see a
[https://github.com/django/django/pull/15077 discussion in PR].
--
Ticket URL: <https://code.djangoproject.com/ticket/33420#comment:1>
--
Ticket URL: <https://code.djangoproject.com/ticket/33420#comment:2>
Comment (by Claude Paroz):
I'm also surprised that was not reported more often. Could this be related
to the Debian-packaged Python 3.9 version?
--
Ticket URL: <https://code.djangoproject.com/ticket/33420#comment:3>
Comment (by Raphaël Hertzog):
Replying to [comment:3 Claude Paroz]:
> I'm also surprised that was not reported more often. Could this be
related to the Debian-packaged Python 3.9 version?
Did you also reproduce it on a Debian 11 system? Debian 11 has Python
3.9.2 so not the latest 3.9.x. Apart from this, I'm not sure that the
Debian-packaged version has any meaninful difference compared to upstream.
But I'm not even sure that it's strictly related to the Python version.
IIRC I got a similar error on another system running Django 2.2.24 on
Debian 10 with Python 3.7.3.
--
Ticket URL: <https://code.djangoproject.com/ticket/33420#comment:4>
Comment (by Claude Paroz):
Yes, I'm now using Debian 11 everywhere with packaged Python. I don't
remember seeing such errors when I was on Debian 10.
--
Ticket URL: <https://code.djangoproject.com/ticket/33420#comment:5>