Skip to content

get_language_bundle examples crash on comment lines in current localization bundles #248

Closed

Description

@MarTrepodi

Bug Description

examples/Sync/get_language_bundle.py and examples/Async/get_language_bundle.py build a lookup dict with key, value = line.split("|") on every line of Loc_GER_DE.txt. Current localization bundles contain comment lines with no |, such as # Start Category: Star_Wars_Strategy_RPG, # End Category: ... (65847 strings) and a bare #. The unpack fails on the first of these, so both examples crash.

The library itself is not affected. create_localized_unit_name_dictionary and get_localization_dictionary in helpers/_game_data.py already skip lines that start with # or contain no |, and they split on the first | only. Only the examples are out of date.

Steps to Reproduce

uv run python examples/Sync/get_language_bundle.py

The example uses the default Comlink URL; point it at any public Comlink release.

Expected Behavior

The example builds the German string lookup without errors.

Actual Behavior

Reproduced on develop (9cc3760) against public Comlink spec 0.40.5, localization bundle OBB_J6BeSg-RcgUauXQFYA. Of 72,358 lines, 83 are # comment lines with no |:

ValueError: not enough values to unpack (expected 2, got 1)

Suggested Fix

  • Skip comment and blank lines, and split on the first | only (line.partition("|")), as the library helper does.
  • Better still, point readers to get_localization_dictionary, which already handles these lines and has resource limits.

Activity

  1. added
    bug
    documentation
    on Nov 7, 2026
  2. github-actions commented on Nov 7, 2026

    @github-actions
    Contributor

    Addressed by #259, which is now merged into develop. This issue will close automatically when that change is released to main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdocumentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions