public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/28668] New: Py_SetProgramName will be deprecated in Python 3.11
@ 2021-12-07 16:08 kevinb at redhat dot com
2022-07-01 8:16 ` [Bug python/28668] " mark at klomp dot org
2023-03-17 18:34 ` tromey at sourceware dot org
0 siblings, 2 replies; 3+ messages in thread
From: kevinb at redhat dot com @ 2021-12-07 16:08 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=28668
Bug ID: 28668
Summary: Py_SetProgramName will be deprecated in Python 3.11
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: python
Assignee: unassigned at sourceware dot org
Reporter: kevinb at redhat dot com
Target Milestone: ---
Py_SetProgramName, which is called from gdb/python/python.c, will be deprecated
in Python 3.11. When that happens, we can expect to error messages like this
when building GDB with -Werror:
../../gdb/python/python.c:1757:21: error: 'void Py_SetProgramName(const
wchar_t*)' is deprecated [-Werror=deprecated-declarations]
1757 | Py_SetProgramName (progname_copy);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:92,
from ../../gdb/python/python-internal.h:86,
from ../../gdb/python/python.c:92:
/usr/include/python3.11/pylifecycle.h:37:38: note: declared here
37 | Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t
*);
| ^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
In order to work around this problem, -Wno-deprecated-declarations may be
appended to the set of warning flags used to build GDB.
However, long term, we'll need to adjust do_start_initialization() in python.c
to use the PyConfig mechanisms introduced in Python 3.8.
For reference, see:
https://bugs.python.org/issue44113
https://docs.python.org/3.11/whatsnew/3.11.html
https://docs.python.org/3.11/c-api/init_config.html#c.PyConfig
The latter link contains an example which shows how to call
PyConfig_SetString() to set the program_name field in the PyConfig struct.
Sadly, we'll still need to support the use of Py_SetProgramName in
gdb/python/python.c because (I anticipate that) the GDB community will want to
support building against Python versions older than 3.8 for a while yet.
I recommend use of '#if Py_VERSION_HEX < 0x308000' to separate the new PyConfig
calls from the existing calls to Py_SetProgramName.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug python/28668] Py_SetProgramName will be deprecated in Python 3.11
2021-12-07 16:08 [Bug python/28668] New: Py_SetProgramName will be deprecated in Python 3.11 kevinb at redhat dot com
@ 2022-07-01 8:16 ` mark at klomp dot org
2023-03-17 18:34 ` tromey at sourceware dot org
1 sibling, 0 replies; 3+ messages in thread
From: mark at klomp dot org @ 2022-07-01 8:16 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=28668
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at klomp dot org
--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
Kevin posted a patch:
https://sourceware.org/pipermail/gdb-patches/2022-June/190460.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug python/28668] Py_SetProgramName will be deprecated in Python 3.11
2021-12-07 16:08 [Bug python/28668] New: Py_SetProgramName will be deprecated in Python 3.11 kevinb at redhat dot com
2022-07-01 8:16 ` [Bug python/28668] " mark at klomp dot org
@ 2023-03-17 18:34 ` tromey at sourceware dot org
1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2023-03-17 18:34 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=28668
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |tromey at sourceware dot org
Resolution|--- |FIXED
Target Milestone|--- |13.1
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
This was fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-03-17 18:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 16:08 [Bug python/28668] New: Py_SetProgramName will be deprecated in Python 3.11 kevinb at redhat dot com
2022-07-01 8:16 ` [Bug python/28668] " mark at klomp dot org
2023-03-17 18:34 ` tromey at sourceware dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).