Skip to content

Error in ucode configure #103

Description

@rohita5l

I got an issue while testing ucode, tried to file it to your repo but it looks like the it does not allow for external issues nor PRs, so here is the description so you can pass it along to the maintainer.

when doing ucode configure and then selecting "Enter a different URL" the cli is breaking with:
ValueError: too many values to unpack (expected 2)

The issue in ui.py (line 206) is that the code assumes choice is always a (host, profile_name) tuple without verifying it, but when "Enter a different URL" is selected, questionary returns that string as value instead of a tuple, failing because it tries to split that string into 2 variables.

The proposal is to change if choice is not None to if isinstance(choice, tuple). In other words, the issue is that a string and None are both "not None", so the current check cannot tell them apart. By using isintance the check only unpacks choice when it's actually a tuple, letting both None and any other string fall through to the manual URL input prompt.

Once this change is done, rebuilding ucode works as expected on my end.
uv tool install --reinstall .

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions