r266-tech f8fca7a72f
fix: add __iter__ and __next__ to FileWrapper for PEP 3333 compliance (#3550)
* fix: add __iter__ and __next__ to FileWrapper for PEP 3333 compliance

The WSGI spec (PEP 3333) requires that wsgi.file_wrapper return an
iterable object. Gunicorn's FileWrapper only implemented __getitem__,
which technically makes it iterable via old-style iteration but breaks
code that explicitly relies on the iterator protocol (e.g., calling
iter() or using next()).

This adds __iter__ (returning self) and __next__ to make FileWrapper
a proper iterator, maintaining backward compatibility with existing
__getitem__-based usage.

Fixes #3396

* Fix lint: move imports to top of file

---------

Co-authored-by: contributor <noreply@users.noreply.github.com>
Co-authored-by: Benoit Chesneau <bchesneau@gmail.com>
2026-03-24 22:38:16 +01:00
..
2026-02-06 08:21:18 +01:00
2026-02-06 08:21:18 +01:00
2024-04-22 03:33:30 +02:00
2026-01-27 09:57:32 +01:00
2026-01-27 09:57:32 +01:00
2026-02-06 08:21:18 +01:00
2026-02-06 08:21:18 +01:00
2024-04-22 03:33:14 +02:00
2024-04-22 03:33:14 +02:00
2026-02-06 08:21:18 +01:00
2024-04-22 03:33:14 +02:00