robotpy / robotpy/mostrobotpy

Fix ntcore overloads during pybind11 upgrade

Open
#318 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
27
Forks
29
Avg merge
4d 6h
Merged PRs (30d)
12

Description

From 🤖 :

Confirmed: the failure is caused by pybind11 3.1’s change in PR #5879.

- Reproduced: 1 failed, 58 passed, 1 xfailed.
- test_getvalue_overloads fails because put_value("boolean", True) stores double 1.0, not boolean True.

Root cause: These bindings register the double overload before bool. Previously, pybind11 rejected booleans for double during its first, no-conversion overload pass.
Version 3.1 accepts Python integers in that pass—and Python booleans are integer subclasses. Consequently, the earlier double overload wins.

Confirmed affected methods:
- NetworkTable.put_value
- NetworkTable.set_default_value
- NetworkTableEntry.set_value
- NetworkTableEntry.set_default_value

Their overloads are in:
- subprojects/pyntcore/ntcore/src/NetworkTable.cpp.inl
- subprojects/pyntcore/ntcore/src/NetworkTableEntry.cpp.inl

Recommended fix: Register bool first, with .noconvert() on its value argument, followed by double. This prioritizes actual booleans without allowing the boolean overload to
absorb other numeric inputs. Adding .noconvert() to double alone won’t help under the new semantics

---

There probably are other places (datalog?) that this may affect.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with test_getvalue_overloads and inspect the affected overloads in subprojects/pyntcore/ntcore/src/NetworkTable.cpp.inl and NetworkTableEntry.cpp.inl. Check the four named methods and any related datalog bindings, then run the relevant tests; done means boolean values remain booleans while other numeric inputs retain their existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.