This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Py_SequenceFast can mask errors
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: glchapman, rhettinger
Priority: normal Keywords:

Created on 2004-01-06 14:53 by glchapman, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
abstract.c.diff glchapman, 2004-01-06 14:53
Messages (2)
msg19562 - (view) Author: Greg Chapman (glchapman) Date: 2004-01-06 14:53
I just ran into a case where a generator passed to 
list.extend was raising the error "argument to list.extend
() must be iterable".  It turned out that code inside the 
generator was causing a TypeError.  This error was then 
caught by PySequence_Fast, which remapped it to its 
error string parameter.

Attached is a modified PySequence_Fast which should 
avoid this kind of masking.
msg19563 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-01-11 23:27
Logged In: YES 
user_id=80475

I'm accepting this for Py2.4 but doubt that it should be
backported to Py2.3.  Since only the message changes, no
ones code will live or die by this one.

Thanks for the patch.

See Objects/abstract.c 2.123.
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39773
2004-01-06 14:53:38glchapmancreate