š `needtable :sort:` crashes on an unset typed field (`None` beside `int`)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- documentation
Research direction
The sort logic is in packages/sphinx-needs/src/sphinx_needs/directives/needtable.py around lines 440-455, where raw field values are compared. Compare it with the :sort_by: handling in filter_common.py around lines 231-238, which already catches an unknown key. Reproduce with two needs, one with :priority: 3 and one without, sorted by :sort: priority. Done when that build no longer raises TypeError, the unset value sorts consistently, and an unknown sort key produces a warning instead of a KeyError.
Written by the indexing model from the issue text.
Description
needtable's :sort: compares raw field values (packages/sphinx-needs/src/sphinx_needs/directives/needtable.py:440-455). An unset typed field is None, so sorting by an integer or number field in a table that contains a need without a value raises TypeError: '<' not supported between instances of 'NoneType' and 'int', uncaught, and the build stops with "Extension error".
Measured at master 3210ac5c (2026-10-14): :sort: priority on two needs, one with :priority: 3 and one without. An unknown sort key is also a KeyError that is not caught on this path, while :sort_by: in process_filters catches it (filter_common.py:231-238).
Proposal: sort with a key that orders None first (or last) and never compares it to a value, and report an unknown key as a warning like :sort_by: does.
- Dominant language
- Python
- Stars
- 309
- Forks
- 103
- Avg merge
- 11h 26m
- Merged PRs (30d)
- 118
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up ā it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from useblocks/sphinx-needs
-
documentation pkg: sphinx-needs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
useblocks/sphinx-needs#2255 Ā·
Maintainers usually reply within 1 day
-
bug pkg: sphinx-needs
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
useblocks/sphinx-needs#2251 Ā·
Maintainers usually reply within 1 day
-
bug pkg: sphinx-needs
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
useblocks/sphinx-needs#2249 Ā·
Maintainers usually reply within 1 day
-
documentation pkg: sphinx-test-reports
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
useblocks/sphinx-needs#2247 Ā·
Maintainers usually reply within 1 day
-
documentation pkg: workspace
Difficulty 1/5 Under an hour Newbie friendliness 82/100
useblocks/sphinx-needs#2236 Ā·
Maintainers usually reply within 1 day
All issues in useblocks/sphinx-needs
Similar issues
-
customer-reported question
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Azure/azure-sdk-for-python#49548 Ā· 1 comment Ā· 1 reaction Ā·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
btclib-org/btclib-wallet#409 Ā·
Maintainers usually reply within 1 day
-
Phase 2 PSA Capability & Career Profile
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
bcgov/digital-journeys#2310 Ā·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fastmachinelearning/hls4ml#1582 Ā·
Maintainers usually reply within 3 days
-
Sort modelsOpenenhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day