falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.53k stars 945 forks source link

Static route fails to serve byterange on Meinheld #1992

Open vytas7 opened 3 years ago

vytas7 commented 3 years ago

Apparently, setting resp.stream to a file-like object without a file descriptor (i.e., without a .fileno() method, such as a pure Python wrapper implementing .read()), fails in Meinheld with a TypeError.

I am of the opinion that Meinheld's behaviour is in direct violation of PEP 3333 on the matter, and filed this as a bug: https://github.com/mopemope/meinheld/issues/130. However, since Meinheld is one of the fastest ways to run Falcon, we probably need to decide whether we want to patch this on our side, document as a known limitation, or take another action (please suggest).

CaselIT commented 3 years ago

we probably need to decide whether we want to patch this on our side, document as a known limitation, or take another action (please suggest).

Personally I think we could just document this case. As an alternative we could provide a different implementation but I think it would be better to make it configurable by the user and not activating it automatically when running under a wsgi server