I think this is the exact issue I had here: https://github.com/django/asgiref/issues/529
I posted a workaround on the issue:
import sys
import io
from asgiref.wsgi import WsgiToAsgi, WsgiToAsgiInstance
class WsgiToAsgiInstanceFixed(WsgiToAsgiInstance):
def build_environ(self, scope, body):
environ = super().build_environ(scope, body)
# environ["wsgi.errors"] = io.StringIO() # Doesn't print anything ?
environ["wsgi.errors"] = sys.stderr
return environ
class WsgiToAsgiFixed(WsgiToAsgi):
async def __call__(self, scope, receive, send):
await WsgiToAsgiInstanceFixed(self.wsgi_application)(scope, receive, send)