Summary
In generation/pdf_renderer.py, the nested function _emit_rich_line declares
nonlocal truncated but never assigns to it, making the declaration a no-op and
potentially leaving PDF content overflow undetected.
Steps to reproduce
- Open
backend/generation/pdf_renderer.py
- Find the nested function
_emit_rich_line (around line 414)
- Note
nonlocal truncated at line 419 — no assignment to truncated exists in the function
- Run: python -m pyflakes generation/pdf_renderer.py
Output confirms the warning at line 419
Expected behavior
Either:
_emit_rich_line sets truncated = True when rendered content exceeds page bounds, or
- The
nonlocal truncated declaration is removed if the function intentionally only reads the flag
Without one of these fixes, oversized PDF content processed by this function may not
trigger the truncation guard in the outer scope.
OS / app version
OS: Windows 11, App version: JustHireMe v0.1
Summary
In
generation/pdf_renderer.py, the nested function_emit_rich_linedeclaresnonlocal truncatedbut never assigns to it, making the declaration a no-op andpotentially leaving PDF content overflow undetected.
Steps to reproduce
backend/generation/pdf_renderer.py_emit_rich_line(around line 414)nonlocal truncatedat line 419 — no assignment totruncatedexists in the functionOutput confirms the warning at line 419
Expected behavior
Either:
_emit_rich_linesetstruncated = Truewhen rendered content exceeds page bounds, ornonlocal truncateddeclaration is removed if the function intentionally only reads the flagWithout one of these fixes, oversized PDF content processed by this function may not
trigger the truncation guard in the outer scope.
OS / app version
OS: Windows 11, App version: JustHireMe v0.1