A class that raises on __qualname__ escapes the request type check as its own exception
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read the Codec.send implementation (called Codec.write on main) and its docstring, then locate the request type check and related tests. Add a test using a metaclass whose __getattribute__ raises for __qualname__; make sure the resulting error is a TypeError that keeps the cause. The payload does not name a test file, so find the existing codec tests.
Written by the indexing model from the issue text.
Description
What happens. Codec.send (on main, Codec.write) promises a TypeError for a value that is not exactly the declared record. The message is built with type(value).__qualname__ outside any guard, so a value whose metaclass raises on __qualname__ surfaces as that exception, for example RuntimeError, at Pydantic 2.12.0 and 2.14.3.
Expected. A TypeError that keeps the cause, as the docstring says.
Impact. Minor: it fails closed, nothing is written or sent, and the class has to be built on purpose. Found while reviewing #43; main at 14309e7 behaves the same.
Fix. Build the wrong-type message with guarded name access, or turn any exception raised while building it into the TypeError. Test with a metaclass whose __getattribute__ raises for __qualname__.
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- Avg merge
- 5h 30m
- Merged PRs (30d)
- 85
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
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 stack314/django-neolith
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#142 · 1 comment ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#141 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
stack314/django-neolith#140 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
stack314/django-neolith#126 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
stack314/django-neolith#119 · 2 comments ·
Maintainers usually reply within 1 day
All issues in stack314/django-neolith
Similar issues
-
automated endpoint-dead needs-curation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
almanac-data/climate-almanac#138 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OceanDataTools/openrvdas#760 ·
Maintainers usually reply within 1 day
-
level/subtask type/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wazuh/wazuh-virtual-machines#1091 ·
Maintainers usually reply within 1 day
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
LedgerHQ/app-bitcoin-legacy#306 ·