Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-116436: Improve error message when TypeError occurs during dict update#116443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hopefully this is a good use of exception notes, since it's just adding context. If not, maybe something with |
@@ -3515,13 +3515,14 @@ merge_from_seq2_lock_held(PyObject *d, PyObject *seq2, int override) | |||
} | |||
/* Convert item to sequence, and verify length 2. */ | |||
fast = PySequence_Fast(item, ""); | |||
fast = PySequence_Fast(item, "object is not iterable"); |
hauntsaninjaMar 6, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Technically, I guessPyObject_GetIter
has a different error message for the edge case where__iter__
exists but returns a non-iterator.
I think nicest thing would be to changePySequence_Fast
so that ifm
is NULL it doesn't clobber the message
python-cla-botbot commentedApr 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
7e8b153
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The example I gave in the issue now looks like:
Previously it was just: