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: _tkinter._flatten() doesn't check PySequence_Size() error code
Type: Stage:
Components: Library (Lib) Versions: Python 3.0, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, gpolo, vstinner
Priority: normal Keywords: patch

Created on 2008-09-16 13:44 by vstinner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_tkinter_flatten.patch vstinner, 2008-09-16 13:44 Patch+test for this issue
Messages (5)
msg73300 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2008-09-16 13:44
PySequence_Size() returns -1 on TypeError (object has no size), but 
_tkinter._flatten() ignores this error. Here is a patch with a 
testcase for _tkinter.
msg73333 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-09-17 13:11
Looks fine, doesn't break anything in Tkinter either.
msg77639 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2008-12-11 23:09
gpolo reviewed the patch. So can anyone apply the patch?
msg80793 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2009-01-29 23:21
The bug is still here in py3k:

$ cat bla.py
import _tkinter, gc
_tkinter._flatten(True)
gc.collect()

$ ./python bla.py
Exception TypeError: "object of type 'bool' has no len()" in 'garbage 
collection' ignored
Fatal Python error: unexpected exception during garbage collection
Abandon (core dumped)

Can anyone apply my patch?
msg80805 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-01-30 02:25
Applied in r69113.
History
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48130
2009-01-30 02:25:13benjamin.petersonsetstatus: open -> closed
resolution: fixed
messages: + msg80805
nosy: + benjamin.peterson
2009-01-29 23:21:47vstinnersetmessages: + msg80793
2008-12-11 23:09:24vstinnersetmessages: + msg77639
2008-09-17 13:11:11gpolosetnosy: + gpolo
messages: + msg73333
2008-09-16 13:44:15vstinnercreate