Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

šŸ› `needtable :sort:` crashes on an unset typed field (`None` beside `int`)

Open Beginner friendly
#2,253 0 comments 0 reactions 0 assignees View on GitHub

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

bug pkg: sphinx-needs

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from useblocks/sphinx-needs

All issues in useblocks/sphinx-needs

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.