kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Report options.ini syntax and encoding errors without a traceback

Open rtibbles opened this issue 2 weeks ago • 3 comments

🙂 Looking for an issue? Welcome! This issue is open for contribution. If this is the first time you’re requesting an issue, please:

  • Read Contributing guidelines carefully. Pay extra attention to Using generative AI. Pull requests and comments that don’t follow the guidelines won’t be answered.
  • Confirm that you’ve read the guidelines in your comment.

Overview

When options.ini has a syntax or encoding error, every kolibri command fails with a raw traceback from configobj or the decoder. Invalid values already get a clean error message and an exit. #15832 covers the matching problem when writing the file.

Complexity: Low Target branch: develop

Context

On develop at fe298f5449, read_options_file raises:

  • configobj.ParseError for a stray line such as garbage line
  • DuplicateError for a repeated key, and ConfigObjError for a repeated section
  • UnicodeDecodeError for a file saved as Windows-1252 ("ANSI" in Notepad) containing PROJECT = café
  • ParseError for a file saved as UTF-16

A UTF-8 file with a byte order mark reads correctly.

The Change

  • Syntax and encoding errors in options.ini should be reported the way invalid values are.

Acceptance Criteria

  • [ ] Each file under Context makes kolibri manage listchannels exit with a message naming options.ini, the line or problem, and no traceback.
  • [ ] Valid options.ini files, with or without a UTF-8 byte order mark, read as before.

AI usage

I had Claude Code sweep Kolibri's command-line tools and configuration handling for crashes on bad input and reproduce each one. I chose the grouping. Claude Code drafted the issue.

rtibbles avatar Nov 15 '26 20:11 rtibbles

Hi! 👋

This issue is available for contribution and supports self-assignment. Here's how to get started:

  • Comment /assign to assign yourself to this issue
  • You can have up to 2 issues assigned at a time across all community repos
  • Dropping an issue has a 7-day cooldown before the slot opens up
  • Link your pull request to this issue when you submit it

📖 Read the Contributing guidelines before starting.

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Nov 15 '26 21:11 learning-equality-bot

/assign

I've read the contributing guidelines, including the part on generative AI. I'd like to work on this one.

NachiketPatil26 avatar Nov 16 '26 07:11 NachiketPatil26

Hi! 👋

You've been assigned to this issue. Here's what to do next:

  • Read the issue description carefully and make sure you understand the requirements
  • Link your pull request to this issue when you submit it
  • If you can no longer work on this, unassign yourself so others can pick it up

Good luck! 😊

Are you preparing for Google Summer of Code? See our GSoC guidelines.

learning-equality-bot avatar Nov 16 '26 07:11 learning-equality-bot