classification
Title: Py_FinalizeEx unconditionally exists in Py_LIMITED_API
Type: crash Stage: resolved
Components: Interpreter Core Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: AJNeufeld, martin.panter, miss-islington, ned.deily, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-11-15 18:24 by AJNeufeld, last changed 2018-12-24 16:33 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10620 merged AJNeufeld, 2018-11-20 21:04
PR 11268 merged miss-islington, 2018-12-20 21:11
PR 11269 merged miss-islington, 2018-12-20 21:11
Messages (6)
msg329959 - (view) Author: Arthur Neufeld (AJNeufeld) * Date: 2018-11-15 18:24
In application compiled with
  #define Py_LIMITED_API 0x03040000
this method was used
  Py_FinalizeEx()

Tested application with:
  SET PATH=...;C:\Program Files\Python35
  APPLICATION.EXE


Result:
  Entry Point Not Found

  (X)  The procedure entry point Py_FinalizeEx could not be located
       in the dynamic link library
       C:\PATH\TO\APPLICATION.EXE


Expected Result:
  Application runs


Rebuilding, after replacing Py_FinalizeEx(void) with Py_Finalize(void):
  Application runs when pointing to 3.5 DLLs.


Suggested resolution:
  Declaration should be restricted to ABI 3.6+:

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
PyAPI_FUNC(int) Py_FinalizeEx(void);
#endif
msg330383 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-11-25 03:21
I added the Py_FinalizeEx API in Issue 5319, but was relying on input from others about dealing with Py_LIMITED_API. After reading the documentation <https://docs.python.org/3.6/c-api/stable.html>, I now see that the function would be considered part of the limited API because its documentation doesn’t say otherwise. So Arthur’s resolution is correct.
msg332260 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-20 21:11
New changeset 3e8f962e63c2f929604443531a9a3aced242f3e8 by Serhiy Storchaka (Arthur Neufeld) in branch 'master':
bpo-35259: Limit `Py_FinalizeEx()` to `Py_LIMITED_API >= 0x03060000`. (GH-10620)
https://github.com/python/cpython/commit/3e8f962e63c2f929604443531a9a3aced242f3e8
msg332264 - (view) Author: miss-islington (miss-islington) Date: 2018-12-20 21:39
New changeset d1e717588728a23d576c4ead775f7dbd68149696 by Miss Islington (bot) in branch '3.7':
bpo-35259: Limit `Py_FinalizeEx()` to `Py_LIMITED_API >= 0x03060000`. (GH-10620)
https://github.com/python/cpython/commit/d1e717588728a23d576c4ead775f7dbd68149696
msg332267 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-12-20 21:52
New changeset 5241ecff161ccf34083b6a824d1ae6d79917d889 by Ned Deily (Miss Islington (bot)) in branch '3.6':
bpo-35259: Limit `Py_FinalizeEx()` to `Py_LIMITED_API >= 0x03060000`. (GH-10620) (GH-11269)
https://github.com/python/cpython/commit/5241ecff161ccf34083b6a824d1ae6d79917d889
msg332491 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2018-12-24 16:33
New changeset ffc106c596d87e6e41bf9a3b69a5943317914afd by Ned Deily (Miss Islington (bot)) in branch '3.7':
bpo-35259: Limit `Py_FinalizeEx()` to `Py_LIMITED_API >= 0x03060000`. (GH-10620)
https://github.com/python/cpython/commit/ffc106c596d87e6e41bf9a3b69a5943317914afd
History
Date User Action Args
2018-12-24 16:33:09ned.deilysetmessages: + msg332491
2018-12-21 06:21:02serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-12-20 21:52:13ned.deilysetnosy: + ned.deily
messages: + msg332267
2018-12-20 21:39:39miss-islingtonsetnosy: + miss-islington
messages: + msg332264
2018-12-20 21:11:21miss-islingtonsetpull_requests: + pull_request10505
2018-12-20 21:11:15miss-islingtonsetpull_requests: + pull_request10504
2018-12-20 21:11:05serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg332260
2018-11-25 03:21:03martin.pantersetmessages: + msg330383
2018-11-20 21:04:53AJNeufeldsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9868
2018-11-15 18:35:39serhiy.storchakasetnosy: + martin.panter
2018-11-15 18:24:51AJNeufeldcreate