fix: empty list causes a crash due to index out of range, explictly raise ValueError now#2171
Conversation
|
@kurtmckee can you take a look? |
|
@meganlkm I continue to think that an empty options list should manifest as a @pydanny and @audreyfeldroy Would you take a gander at this behavioral change? Here's the summary: When cookiecutter is told NOT TO ASK the user for input, but the list of choices to select from is empty:
The current behavior is incorrect, but I don't think the solution is to return a hard-coded empty string. If returning an empty string seems like correct, new behavior to you, this PR is good for merging. |
|
sorry, i was about to suggest and well ... not enough coffee here |
…aise ValueError now (cookiecutter#2171) * fix issue where empty list causes a crash due to index out of range * Update cookiecutter/prompt.py * Update tests/test_prompt.py * Update cookiecutter/prompt.py * Update tests/test_prompt.py --------- Co-authored-by: Jens W. Klein <jk@kleinundpartner.at>
Fixes the issue where sending an empty list in the options will raise an
IndexErrorexception.PR includes:
More details:
python:3.13-slimimageOther observations: