Report options.ini syntax and encoding errors without a traceback
🙂 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.ParseErrorfor a stray line such asgarbage lineDuplicateErrorfor a repeated key, andConfigObjErrorfor a repeated sectionUnicodeDecodeErrorfor a file saved as Windows-1252 ("ANSI" in Notepad) containingPROJECT = caféParseErrorfor 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.inishould be reported the way invalid values are.
Acceptance Criteria
- [ ] Each file under Context makes
kolibri manage listchannelsexit with a message namingoptions.ini, the line or problem, and no traceback. - [ ] Valid
options.inifiles, 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.
Hi! 👋
This issue is available for contribution and supports self-assignment. Here's how to get started:
- Comment
/assignto 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.
/assign
I've read the contributing guidelines, including the part on generative AI. I'd like to work on this one.
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.