Skip to content

Comments in config.ini are treated as options #673

@guihkx

Description

@guihkx

Platform

Operating system and version: Arch Linux
Legendary version: 0.20.34

Expected Behavior

Comments in ~/.config/legendary/config.ini should be completely ignored.

Current Behavior

Comments in ~/.config/legendary/config.ini are treated as options.

Steps to Reproduce

  1. ~/.config/legendary/config.ini:
[legendary]
# foo
# foo
log_level = debug
  1. legendary list-installed:
[LGDLFS] ERROR: Unable to read configuration file, please ensure that file is valid! (Error: While reading from '/home/gui/.config/legendary/config.ini' [line  4]: option '# foo' in section 'legendary' already exists)
[LGDLFS] WARNING: Continuing with blank config in safe-mode...

Installed games:
 * Rocket League® (App name: Sugar | Version: BC2_Update52+462850 | Platform: Windows | 30.51 GiB)

Total: 1

I'm also not allowed to add a comment at the top of the config file, i.e.:

# ~/.config/legendary/config.ini
[legendary]
# foo
# foo
log_level = debug
$ legendary list-installed
[LGDLFS] ERROR: Unable to read configuration file, please ensure that file is valid! (Error: File contains no section headers.
file: '/home/gui/.config/legendary/config.ini', line: 1
'# ~/.config/legendary/config.ini\n')
[LGDLFS] WARNING: Continuing with blank config in safe-mode...

Installed games:
 * Rocket League® (App name: Sugar | Version: BC2_Update52+462850 | Platform: Windows | 30.51 GiB)

Total: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions