django-pdb
django-pdb copied to clipboard
Error after django upgrade to 4.1
AttributeError: 'PdbMiddleware' object has no attribute '_is_coroutine'
seems to be coming from not calling super().__init__()
in the PdbMiddleware
I added line 41 - first line in the __init__functon:
def __init__(self, get_response=None, debug_only=True):
"""
If debug_only is True, this middleware removes itself
unless settings.DEBUG is also True. Otherwise, this middleware
is always active.
"""
super().__init__(get_response)
self.get_response = get_respose
if debug_only and not settings.DEBUG:
raise MiddlewareNotUsed()
that in turn calls _async_check()
correctly from class deprecation.MiddlewareMixin
2nd line self.get_response = get_response
should be removed then...
I patched it with
from django_pdb.middleware import PdbMiddleware
if not hasattr(PdbMiddleware, '_is_coroutine'):
setattr(PdbMiddleware, '_is_coroutine', False)
But it’s better in the super
is called correctly
why did you not want to call super().init?
@sebhaase I’m not a django-pdb
developper. I just answer how I patched in on my project waiting for this issue to be resolved (using a call to super().__init__
)
@sebhaase Can you propose a merge request?
I suppose we should wait until "a maintainer/author" of this project shows up...
One year later… Is this project still maintained?