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: calling nonexisting function under __INSURE__
Type: compile error Stage:
Components: Interpreter Core Versions: Python 3.1, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, eli.bendersky, ncoghlan, terry.reedy
Priority: normal Keywords: patch

Created on 2010-09-13 06:19 by eli.bendersky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue9844.py3k.1.patch eli.bendersky, 2011-01-14 05:32
Messages (8)
msg116281 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2010-09-13 06:19
The Py_Main function has a section under #ifdef __INSURE__ at the end, where it does:

    _Py_ReleaseInternedStrings();
    _Py_ReleaseInternedUnicodeStrings();

The first function doesn't exist in Python 3K, so there will be a compile error with __INSURE__ defined.
msg116332 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2010-09-13 17:34
Barry, I've taken the liberty to add you to the nosy list because I found in the logs you've originally added this code (in 2001!!)

I hope it's OK with you :-)
msg125801 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-01-08 21:37
If the source will not compile with __INSURE__ defined, then perhaps no one has ever tried to do that with 3.x. That would suggest that the ifdef could be removed. In any case, the non-function call should be removed.
Is the other function called anywhere else? 

Which file contains this code, and which has the functions in 2.7 (so I can verify removal in 3.x)?
msg126227 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-14 05:15
This code is in Modules/main.c, function Py_Main.


In 2.7, only _Py_ReleaseInternedStrings is called, and this function is defined in Objects/stringobject.c

In 3k, the two functions are called as specified above. _Py_ReleaseInternedStrings doesn't exist in 3k, and _Py_ReleaseInternedUnicodeStrings is defined in Objects/unicodeobject.c

I will now supply a patch that removes the call.
msg126230 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-14 05:32
Attaching a patch that removes the call of the non-existing function in py3k. I ran the test suite and make patchcheck.

I don't remove the whole __INSURE__ since someone might still want it in (and I don't have the tool to play around with it). But the call should definitely go, since it won't compile this way.

Nick, Terry - your approval - and I'll commit this.
msg126236 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2011-01-14 07:23
A quick Google search suggests that code is there to make Insure++ happy, so +1 for Eli's simple fix. Georg hasn't closed the py3k branch yet, so go ahead and commit it.

(3.2c1 is due this Saturday, so it's worth keeping a close eye on python-committers for the freeze notice - time zones means the relative timing of things can be surprising)
msg126238 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-14 07:32
Committed r87991
msg126246 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-01-14 08:53
Backported to release31: r87994 (with svnmerge)
History
Date User Action Args
2022-04-11 14:57:06adminsetgithub: 54053
2011-01-14 08:53:13eli.benderskysetstatus: open -> closed

messages: + msg126246
resolution: fixed
nosy: barry, terry.reedy, ncoghlan, eli.bendersky
2011-01-14 07:32:13eli.benderskysetnosy: barry, terry.reedy, ncoghlan, eli.bendersky
messages: + msg126238
2011-01-14 07:23:57ncoghlansetnosy: barry, terry.reedy, ncoghlan, eli.bendersky
messages: + msg126236
2011-01-14 05:32:06eli.benderskysetfiles: + issue9844.py3k.1.patch

messages: + msg126230
keywords: + patch
nosy: barry, terry.reedy, ncoghlan, eli.bendersky
2011-01-14 05:15:28eli.benderskysetnosy: + ncoghlan
messages: + msg126227
2011-01-08 21:37:51terry.reedysetnosy: + terry.reedy
messages: + msg125801
2010-09-13 17:34:48eli.benderskysetnosy: + barry
messages: + msg116332
2010-09-13 06:19:25eli.benderskycreate