Skip to content

An out-of-range or non-numeric port gives a raw traceback #69

Description

@ldbumble

--port is type=int with no range check, and TASKUARY_PORT is read with a bare int():

taskuary --port 70000              -> OverflowError: connect_ex(): port must be 0-65535
TASKUARY_PORT='8080x' taskuary     -> ValueError: invalid literal for int()

config.load() runs for every command, so a bad environment variable breaks all of them.

Where: taskuary/cli.py (the --port argument), taskuary/config.py (_env_server).

Done when argparse rejects a port outside 1-65535 with a normal usage error (exit code 2), and a bad TASKUARY_PORT is ignored with a logged warning (or refused with one clear line).

Test - tests/test_config.py: _env_server() with TASKUARY_PORT='abc' does not raise; parsing --port 70000 raises SystemExit with code 2.


Getting started: pip install -e ".[dev]", then python -m pytest -q (offline, a few seconds). UI work: cd website && npm ci && npm test. See CONTRIBUTING.md. One small PR with the change and its test is perfect.

Activity

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

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions