➜

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
标题: C API: Clarify which C functions are safe to be called before Py_Initialize()
类型: Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
状态: closed Resolution: duplicate
Dependencies: 后续: Py_DecodeLocale() fails if used before the runtime is initialized.
View: 32096
分配给: 抄送列表: Decorater, eric.snow, ncoghlan, ned.deily, serhiy.storchaka, vstinner
优先级: release blocker 关键字:

Created on 2017-11-20 14:21 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (7)
msg306544 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2017-11-20 14:21
See the python-dev thread:
https://mail.python.org/pipermail/python-dev/2017-November/150605.html
msg306588 - (view) Author: Decorater (Decorater) * 日期: 2017-11-20 21:46
For me, it looks like Py_DecodeLocal() is still safe (according to python 3.6.3 unless anything changed in it).
msg306589 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2017-11-20 21:46
> For me, it looks like Py_DecodeLocal() is still safe (according to python 3.6.3 unless anything changed in it).

This issue is a regression in Python 3.7.
msg306590 - (view) Author: Decorater (Decorater) * 日期: 2017-11-20 21:49
Ah, I see now.
msg306615 - (view) Author: Alyssa Coghlan (ncoghlan) * (Python committer) 日期: 2017-11-21 02:06
Issue 32096 covers reverting the change to PyDecode_Locale specifically for 3.7.

We can use this issue to ask the broader question "Do we want to *deprecate* our previously implied support for calling PyDecode_Locale() before Py_Initialize()?"

If the answer is "Yes", then we need to design a transition plan to a different API for setting config parameters that accept "wchar_t *".

If the answer is "No", then we need to document that design constraint on the affected APIs.

Either way, we should also improve the way we communicate the list of C API methods that can be safely called before Py_Initialize.
msg306632 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2017-11-21 07:35
Is there a *need* to break existing code? What is the benefit and how large it in comparison with the necessary of rewriting every code that embeds Python (and supporting both ways for long time)?
msg306657 - (view) Author: STINNER Victor (vstinner) * (Python committer) 日期: 2017-11-21 15:49
I mark this issue as a duplicate of bpo-32096.
历史
日期 用户 动作 参数
2022-04-11 14:58:54admin修改github: 76267
2017-11-21 15:50:27vstinner解链issue32096 superseder
2017-11-21 15:49:51vstinner修改状态: open -> closed
后续: Py_DecodeLocale() fails if used before the runtime is initialized.
消息: + msg306657

resolution: duplicate
stage: resolved
2017-11-21 07:35:15serhiy.storchaka修改抄送: + serhiy.storchaka
消息: + msg306632
2017-11-21 02:06:06ncoghlan修改抄送: + ncoghlan
消息: + msg306615
2017-11-20 22:06:33vstinner链接issue32096 superseder
2017-11-20 21:49:26Decorater修改消息: + msg306590
2017-11-20 21:46:59vstinner修改消息: + msg306589
2017-11-20 21:46:07Decorater修改抄送: + Decorater
消息: + msg306588
2017-11-20 16:09:53serhiy.storchaka修改优先级: normal -> release blocker
抄送: + ned.deily
2017-11-20 15:54:17eric.snow修改抄送: + eric.snow
2017-11-20 14:21:16vstinner创建