Skip to content

Conversation

@joelcapitao
Copy link
Member

@joelcapitao joelcapitao commented Feb 4, 2026

get_treefile() crashes when parsing versions with fewer than 3
components (e.g., "44"). Now we pad the version parts list with
"0" to ensure we always have at least 3 elements.
As a follow-up of e6d3ed2.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly handles short version strings in get_treefile by padding them to prevent crashes. The approach is sound. I've included a suggestion to make the implementation more concise and Pythonic, which improves code readability.

@joelcapitao joelcapitao force-pushed the fix-unpacking-version-issue branch 2 times, most recently from 3432a7b to 6523f12 Compare February 4, 2026 14:06
@joelcapitao joelcapitao requested a review from dustymabe February 4, 2026 14:06
@dustymabe
Copy link
Member

I feel like this needs a heavy comment.

Here is something similar, but might be a little more obvious why the change is needed:

(x, y, _) = version.split('.', 2) if '.' in version else (version, '0', '0')

get_treefile() crashes when parsing versions with fewer than 3
components (e.g., "44"). Now we pad the version parts list with
"0" to ensure we always have at least 3 elements.
As a follow-up of e6d3ed2.
@joelcapitao joelcapitao force-pushed the fix-unpacking-version-issue branch from 6523f12 to 7096f78 Compare February 4, 2026 14:37
@joelcapitao joelcapitao merged commit 0024c48 into coreos:testing-devel Feb 4, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants