#2011·jrnl

Extra quotes required when using config-override on a string that needs to be quoted when in YAML

Author: rudolfaCreated Jun 18, 2025Updated Jul 29, 2025
Labelsbug

Diagnostic output

jrnl: v4.2.1 Python: 3.11.13 (main, Jun 09 2025, 17:26:24) [GCC] OS: Linux 6.15.1-1-default

Current Behavior

jrnl -month 06 --config-override timeformat "%d" --short ┏━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ScannerError ┃ ┃ while scanning for the next token ┃ ┃ found character that cannot start any token ┃ ┃ in "", line 1, column 13 ┃ ┃ ┃ ┃ This is probably a bug. Please file an issue at: ┃ ┃ https://github.com/jrnl-org/jrnl/issues/new/choose ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Expected Behavior

jrnl --config-override timeformat "%d" --short

02 Title 1 04 Title 2 ...

Repro Steps

Just call 'jrnl --config-override timeformat "%d" --short'

Debug output

andy@localhost:~$ jrnl -month 06 --config-override timeformat "%d" --short --debug [14:43:34] DEBUG Logging start main.py:32 DEBUG Parsed args: main.py:42 Namespace(debug=True, preconfig_cmd=None, postconfig_cmd=None, filename=None, template=None, on_date=None, today_in_history=False, month='06', day=None, year=None, start_date=None, end_date=None, contains=None, strict=False, starred=False, tagged=False, limit=None, excluded=[], edit=False, delete=False, change_time=None, export=False, tags=False, short=True, config_override=[['timeformat', '%d']], config_file_path='', text=[], exclude_starred=False, exclude_tagged=False) DEBUG Reading configuration from file /home/andy/.config/jrnl/jrnl.yaml install.py:91 DEBUG Using configuration: install.py:117 "{ 'colors': { 'body': 'none', 'date': 'black', 'tags': 'yellow', 'title': 'cyan' }, 'default_hour': 9, 'default_minute': 0, 'editor': 'vim', 'encrypt': False, 'highlight': True, 'indent_character': '|', 'journals': { 'default': { 'journal': '/home/andy/.local/share/jrnl/work/', 'timeformat': '%d %T' }, 'privat': {'journal': '/home/andy/.local/share/jrnl/privat/'} }, 'linewrap': 79, 'tagsymbols': '#@', 'template': 'work.txt', 'timeformat': '%F %r', 'version': 'v4.2.1' }" File "/home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/main.py", line 44, in run status_code = controller.run(args) ^^^^^^^^^^^^^^^^^^^^ File "/home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/controller.py", line 55, in run config = apply_overrides(args, config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/override.py", line 30, in apply_overrides pairs = make_yaml_valid_dict(pairs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/config.py", line 52, in make_yaml_valid_dict runtime_modifications = YAML(typ="safe").load(yamlstr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/ruamel/yaml/main.py", line 451, in load return constructor.get_single_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/ruamel/yaml/constructor.py", line 114, in get_single_data node = self.composer.get_single_node() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "_ruamel_yaml.pyx", line 706, in ruamel.yaml.clib._ruamel_yaml.CParser.get_single_node File "_ruamel_yaml.pyx", line 724, in ruamel.yaml.clib._ruamel_yaml.CParser._compose_document File "_ruamel_yaml.pyx", line 775, in ruamel.yaml.clib._ruamel_yaml.CParser._compose_node File "_ruamel_yaml.pyx", line 889, in ruamel.yaml.clib._ruamel_yaml.CParser._compose_mapping_node File "_ruamel_yaml.pyx", line 731, in ruamel.yaml.clib._ruamel_yaml.CParser._compose_node File "_ruamel_yaml.pyx", line 904, in ruamel.yaml.clib._ruamel_yaml.CParser._parse_next_event ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/main.py:44 in run │ │ │ │ 43 │ │ │ │ ❱ 44 │ │ status_code = controller.run(args) │ │ 45 │ │ │ │ /home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/controller.py:55 in │ │ run │ │ │ │ 54 │ # Apply config overrides │ │ ❱ 55 │ config = apply_overrides(args, config) │ │ 56 │ │ │ │ /home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/override.py:30 in │ │ apply_overrides │ │ │ │ 29 │ for pairs in overrides: │ │ ❱ 30 │ │ pairs = make_yaml_valid_dict(pairs) │ │ 31 │ │ key_as_dots, override_value = _get_key_and_value_from_pair(pairs) │ │ │ │ /home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/jrnl/config.py:52 in │ │ make_yaml_valid_dict │ │ │ │ 51 │ │ │ ❱ 52 │ runtime_modifications = YAML(typ="safe").load(yamlstr) │ │ 53 │ │ │ │ /home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/ruamel/yaml/main.py:451 │ │ in load │ │ │ │ 450 │ │ try: │ │ ❱ 451 │ │ │ return constructor.get_single_data() │ │ 452 │ │ finally: │ │ │ │ /home/andy/.local/share/pipx/venvs/jrnl/lib64/python3.11/site-packages/ruamel/yaml/constructor.p │ │ y:114 in get_single_data │ │ │ │ 113 │ │ # Ensure that the stream contains a single document and construct it. │ │ ❱ 114 │ │ node = self.composer.get_single_node() │ │ 115 │ │ if node is not None: │ │ │ │ in ruamel.yaml.clib._ruamel_yaml.CParser.get_single_node:706 │ │ │ │ in ruamel.yaml.clib._ruamel_yaml.CParser._compose_document:724 │ │ │ │ in ruamel.yaml.clib._ruamel_yaml.CParser._compose_node:775 │ │ │ │ in ruamel.yaml.clib._ruamel_yaml.CParser._compose_mapping_node:889 │ │ │ │ in ruamel.yaml.clib._ruamel_yaml.CParser._compose_node:731 │ │ │ │ in ruamel.yaml.clib._ruamel_yaml.CParser._parse_next_event:904 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ScannerError: while scanning for the next token found character that cannot start any token in "", line 1, column 13 ┏━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ScannerError ┃ ┃ while scanning for the next token ┃ ┃ found character that cannot start any token ┃ ┃ in "", line 1, column 13 ┃ ┃ ┃ ┃ This is probably a bug. Please file an issue at: ┃ ┃ https://github.com/jrnl-org/jrnl/issues/new/choose ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Other Information

No response