Skip to content

[Bug]: nonlocal truncated declared but never assigned in _emit_rich_line — PDF overflow may go undetected #122

Description

@MaheshAspirant

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

  1. Open backend/generation/pdf_renderer.py
  2. Find the nested function _emit_rich_line (around line 414)
  3. Note nonlocal truncated at line 419 — no assignment to truncated exists in the function
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions