Crash if no docstring is set on a config param #2

Open
opened 2025-12-01 16:46:55 +01:00 by Steffo · 0 comments
Owner
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/steffo/Workspaces/nortrom/nortrom/config.py", line 12, in <module>
    config.cli()
  File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/cfig/config.py", line 345, in cli
    self._click_root()()
  File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/cfig/config.py", line 329, in root
    doc = textwrap.dedent(doc)
          ^^^^^^^^^^^^^^^^^^^^
  File "/home/steffo/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/textwrap.py", line 435, in dedent
    text = _whitespace_only_re.sub('', text)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'NoneType'
``` Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/home/steffo/Workspaces/nortrom/nortrom/config.py", line 12, in <module> config.cli() File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/cfig/config.py", line 345, in cli self._click_root()() File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 1485, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 1406, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 1269, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/click/core.py", line 824, in invoke return callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/steffo/Workspaces/nortrom/.venv/lib/python3.12/site-packages/cfig/config.py", line 329, in root doc = textwrap.dedent(doc) ^^^^^^^^^^^^^^^^^^^^ File "/home/steffo/.local/share/uv/python/cpython-3.12.12-linux-x86_64-gnu/lib/python3.12/textwrap.py", line 435, in dedent text = _whitespace_only_re.sub('', text) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: expected string or bytes-like object, got 'NoneType' ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
steffo/cfig#2
No description provided.