79765384

Date: 2025-09-15 16:25:32
Score: 0.5
Natty:
Report link

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)
Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Arthur Woimbée