← Back to issue list

`humanize_list` accepts any value that can be coerced to a string for the last list item

View original Github issue

Metadata

Project
craft-cli
Number
#413
Type
issue
State
open
Author
lengau
Labels
Type: Bug
Created
Updated
Closed

Current evaluation

humanize_list silently coerces non-string items instead of raising TypeError, inconsistently by position. Maintainer acknowledged it as a real bug but deferred to a future Rust oxidization; a contributor reproduced it on main and awaits direction on intended behavior.

Suggested action: keep open

Reason: Maintainer lengau explicitly acknowledged it as a real bug ("While this is a real bug") and deferred it to a future oxidization, and contributor hericlibong reproduced it on current main (2026-05-17) and is now awaiting a decision on intended behavior (require strings vs accept stringifiable) while offering to help. It is still reproducible on main and last activity was ~3.5 months ago, so it is neither stale nor unassessed.

Impact: 15 Quick Win: 10.8 Staleness: 38 Complexity: 28 Confidence: 72 Support Request: 5

Issue body

### Bug Description This should raise a TypeError but it doesn't: ``` >>> craft_cli.utils.humanize_list(['1', 2]) '1, and 2' ``` While this isn't exactly a big deal, it is an unexpected success that can mislead developers. ### To Reproduce ``` craft_cli.utils.humanize_list(['1', 2]) ``` ### part yaml ```shell ``` ### Relevant log output ```shell n/a ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 15
Quick Win: 10.8
Staleness: 38
Complexity: 28
Confidence: 72
Support Request: 5
keep open humanize_list silently coerces non-string items instead of raising TypeError, inconsistently by position. Maintainer acknowledged it as a real bug but deferred to a future Rust oxidization; a contributor reproduced it on main and awaits direction on intended behavior.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 15
Confidence: 85
Support Request: 0
needs triage humanize_list accepts non-string items without raising TypeError, showing inconsistent behavior based on item position. Currently awaiting maintainer clarification on whether to patch now or defer to the Rust migration.
qwen3.6-35b-a3b-mtp-q6
Staleness: 50
Complexity: 15
Confidence: 85
Support Request: 0
keep open humanize_list coerces non-string items to strings instead of raising TypeError. Currently under discussion regarding intended coercion behavior ahead of an ongoing Rust rewrite.
qwen3.6-35b-a3b-mtp-q6
Staleness: 15
Complexity: 10
Confidence: 90
Support Request: 0
keep open humanize_list inconsistently accepts non-strings, coercing only the last item instead of raising TypeError. Acknowledged, deferred until Rust conversion. A contributor seeks clarification on

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-cli#411 (confidence 55%)

    Oxidization work the maintainer referenced as the path to fixing this; contributor read its Rust impl (item.to_string()) as a hint, though #411 targets the emitter specifically rather than humanize_list.

Related issues

No related issues found above the similarity threshold.