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: Improve set().test_c_api(): don't expect a set("abc"), modify the content
Type: crash Stage:
Components: Interpreter Core Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: rhettinger, vstinner
Priority: low Keywords: patch

Created on 2010-01-31 03:12 by vstinner, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
set_test_c_api.patch vstinner, 2010-01-31 03:12
Messages (4)
msg98596 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-01-31 03:12
test_c_api() method of a set() (only defined in pydebug mode) suppose that the set content is "abc". It causes assertion error if the method is called in a set different than set("abc").

My patch modifies the set content at the beginning of the test.
msg98604 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-01-31 04:26
Will think about this.  The method was supposed to be for internal use only.  May just rename it to _test_c_api() and add a docstring noting that it is only defined for "abc".  

That being said, it may be worthwhile to build-out the test to accept many different possible inputs and possibly do a more thorough exercised of possible inputs and outputs to C functions.
msg98627 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-01-31 21:14
> The method was supposed to be for internal use only

I found this bug by fuzzing.

> it may be worthwhile to build-out the test to accept many different possible inputs (...)

Yeah, but I just want to avoid an assertion error :-)
msg100982 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-03-13 00:23
Commited: r78886 (trunk), r78888 (py3k).
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52066
2010-03-13 00:24:14vstinnersetstatus: open -> closed
resolution: fixed
2010-03-13 00:23:57vstinnersetmessages: + msg100982
2010-01-31 21:14:02vstinnersetmessages: + msg98627
2010-01-31 04:26:20rhettingersetpriority: low

messages: + msg98604
2010-01-31 03:27:14benjamin.petersonsetassignee: rhettinger

nosy: + rhettinger
2010-01-31 03:13:31vstinnersettype: crash
components: + Interpreter Core
versions: + Python 2.7, Python 3.2
2010-01-31 03:12:20vstinnercreate