Skip to content

TKDESIGNER_VERBOSE=true crashes CLI at import with ValueError #480

Description

@chirag127

Problem

Setting TKDESIGNER_VERBOSE to any non-integer string crashes the CLI at import time before argparse runs.

Steps

  1. pip install tkdesigner
  2. TKDESIGNER_VERBOSE=true tkdesigner <url> <token>

Expected

CLI enables verbose logging (as TKDESIGNER_VERBOSE=1 does) or ignores unrecognized values.

Actual

ValueError: invalid literal for int() with base 10: 'true'

Crash at tkdesigner/cli.py:19:

if int(os.getenv("TKDESIGNER_VERBOSE", 0)) == 1:

Same crash for TKDESIGNER_VERBOSE=yes, TKDESIGNER_VERBOSE=on, TKDESIGNER_VERBOSE= (empty).

Environment

tkdesigner 1.0.6 (pyproject.toml), Python 3.9+, OS-independent.

Suggested fix: guard with try/except or match on truthy strings.

Thanks for maintaining ParthJadhav/Tkinter-Designer!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions