Commit ee96b81
fix: raise EncodeError when encoding None with explicit non-NULL type
encode_value(None, ValueType.INTEGER) previously silently returned NULL
bytes with NULL type code, ignoring the caller's explicit type request.
The early-return for None at the top of encode_value fired before the
value_type parameter was inspected.
Now raises EncodeError when value is None and an explicit type other
than ValueType.NULL is provided. encode_value(None) and
encode_value(None, ValueType.NULL) continue to work as before.
Closes #094
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ab2ec61 commit ee96b81
2 files changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
739 | 761 | | |
740 | 762 | | |
741 | 763 | | |
| |||
0 commit comments