You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Iterator passed as append_middleware/prepend_middleware is silently dropped #531
The parameters are typed Iterable[Middleware], but _build_parse_stack consumes the iterable when computing append_stack_types before calling list(append_middleware) (bibtexparser/entrypoint.py:36-45; same pattern in _build_unparse_stack, lines 66-75). A generator/iterator therefore results in an empty middleware list — silently.
lib=bibtexparser.parse_string("@article{x, month = {3}}",
append_middleware=iter([MonthIntMiddleware()]))
lib.entries[0]["month"] # '3' -- middleware was never applied
Fix: materialize to a list at the top of the builders (or type the params as List).
I opened draft PR #569 with the focused fix and public parse/write iterator regressions. The branch is based directly on current main and its full test suite passes.
Activity
claell commentedon Jul 16, 2026
I opened draft PR #569 with the focused fix and public parse/write iterator regressions. The branch is based directly on current main and its full test suite passes.