Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-133644: remove deprecated global configuration variables #133654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 30 commits into
base: main
Choose a base branch
Loading
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
12f494a
remove `Py_BytesWarningFlag`
picnixz May 8, 2025
a6467f8
remove `Py_DebugFlag`
picnixz May 8, 2025
df48806
remove `Py_VerboseFlag`
picnixz May 8, 2025
cfabb22
remove `Py_QuietFlag`
picnixz May 8, 2025
71bca31
remove `Py_InspectFlag`
picnixz May 8, 2025
7ebf7bd
remove `Py_OptimizeFlag`
picnixz May 8, 2025
2d05afe
remove `Py_NoSiteFlag`
picnixz May 8, 2025
2a8e546
remove `Py_FrozenFlag`
picnixz May 8, 2025
93eee09
remove `Py_IgnoreEnvironmentFlag`
picnixz May 8, 2025
311f95c
remove `Py_DontWriteBytecodeFlag`
picnixz May 8, 2025
f5b39db
remove `Py_NoUserSiteDirectory`
picnixz May 8, 2025
c66edb3
remove `Py_UnbufferedStdioFlag`
picnixz May 8, 2025
9116a65
remove `Py_HashRandomizationFlag`
picnixz May 8, 2025
fb2a247
remove `Py_IsolatedFlag`
picnixz May 8, 2025
86c0c87
remove `Py_LegacyWindowsFSEncodingFlag`
picnixz May 8, 2025
eab9e01
remove `Py_LegacyWindowsStdioFlag`
picnixz May 8, 2025
54ff2aa
remove `Py_FileSystemDefaultEncoding` and `Py_HasFileSystemDefaultEnc…
picnixz May 8, 2025
9a322fe
remove `Py_FileSystemDefaultEncodeErrors`
picnixz May 8, 2025
d4ff0f7
fix test_embed
picnixz May 8, 2025
5d59540
blurb
picnixz May 8, 2025
eef039e
update What's New entries
picnixz May 8, 2025
1248cea
update docs
picnixz May 8, 2025
583bafb
update docutils refs
picnixz May 8, 2025
daa1e2d
fixup
picnixz May 8, 2025
6c7baa2
revert `putenv` statements
picnixz May 8, 2025
d9f4def
restore file
picnixz May 8, 2025
279ac00
update stable ABI symbols
picnixz May 8, 2025
cddebbe
revert runtime changes for now
picnixz May 8, 2025
b8afe23
Merge remote-tracking branch 'upstream/main' into cleanup/315/depreca…
picnixz May 9, 2025
8a2173f
Merge remote-tracking branch 'upstream/main' into cleanup/315/depreca…
picnixz Jun 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove Py_DebugFlag
  • Loading branch information
picnixz committed May 8, 2025
commit a6467f8f86ef3f54717e1be78fa508ec80d035fb
13 changes: 0 additions & 13 deletions 13 Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,6 @@ When a flag is set by an option, the value of the flag is the number of times
that the option was set. For example, ``-b`` sets :c:data:`Py_BytesWarningFlag`
to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.

.. c:var:: int Py_DebugFlag

This API is kept for backward compatibility: setting
:c:member:`PyConfig.parser_debug` should be used instead, see :ref:`Python
Initialization Configuration <init-config>`.

Turn on parser debugging output (for expert only, depending on compilation
options).

Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment
variable.

.. deprecated-removed:: 3.12 3.15

.. c:var:: int Py_DontWriteBytecodeFlag

Expand Down
3 changes: 0 additions & 3 deletions 3 Doc/deprecations/c-api-pending-removal-in-3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ Pending removal in Python 3.15

* Global configuration variables:

* :c:var:`Py_DebugFlag`:
Use :c:member:`PyConfig.parser_debug` or
:c:func:`PyConfig_Get("parser_debug") <PyConfig_Get>` instead.
* :c:var:`Py_VerboseFlag`:
Use :c:member:`PyConfig.verbose` or
:c:func:`PyConfig_Get("verbose") <PyConfig_Get>` instead.
Expand Down
1 change: 0 additions & 1 deletion 1 Include/cpython/pydebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
extern "C" {
#endif

Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_DebugFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_VerboseFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_QuietFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_InteractiveFlag;
Expand Down
1 change: 0 additions & 1 deletion 1 Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
COPY_GLOBAL_CONFIG = [
# Copy core config to global config for expected values
# True means that the core config value is inverted (0 => 1 and 1 => 0)
('Py_DebugFlag', 'parser_debug'),
('Py_DontWriteBytecodeFlag', 'write_bytecode', True),
('Py_FileSystemDefaultEncodeErrors', 'filesystem_errors'),
('Py_FileSystemDefaultEncoding', 'filesystem_encoding'),
Expand Down
3 changes: 0 additions & 3 deletions 3 Programs/_testembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,6 @@ static int test_init_global_config(void)
putenv("PYTHONDEBUG=0");
Py_OptimizeFlag = 2;

/* Py_DebugFlag is not tested */

putenv("PYTHONDONTWRITEBYTECODE=");
Py_DontWriteBytecodeFlag = 1;

Expand Down Expand Up @@ -1055,7 +1053,6 @@ static void set_all_global_config_variables(void)
Py_InspectFlag = 1;
Py_InteractiveFlag = 1;
Py_OptimizeFlag = 1;
Py_DebugFlag = 1;
Py_VerboseFlag = 1;
Py_QuietFlag = 1;
Py_FrozenFlag = 0;
Expand Down
4 changes: 0 additions & 4 deletions 4 Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ static const char usage_envvars[] =
/* UTF-8 mode (PEP 540): if equals to 1, use the UTF-8 encoding, and change
stdin and stdout error handler to "surrogateescape". */
int Py_UTF8Mode = 0;
int Py_DebugFlag = 0; /* Needed by parser.c */
int Py_VerboseFlag = 0; /* Needed by import.c */
int Py_QuietFlag = 0; /* Needed by sysmodule.c */
int Py_InteractiveFlag = 0; /* Previously, was used by Py_FdIsInteractive() */
Expand Down Expand Up @@ -521,7 +520,6 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
SET_ITEM_INT(_Py_HasFileSystemDefaultEncodeErrors);

SET_ITEM_INT(Py_UTF8Mode);
SET_ITEM_INT(Py_DebugFlag);
SET_ITEM_INT(Py_VerboseFlag);
SET_ITEM_INT(Py_QuietFlag);
SET_ITEM_INT(Py_InteractiveFlag);
Expand Down Expand Up @@ -1675,7 +1673,6 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
COPY_FLAG(inspect, Py_InspectFlag);
COPY_FLAG(interactive, Py_InteractiveFlag);
COPY_FLAG(optimization_level, Py_OptimizeFlag);
COPY_FLAG(parser_debug, Py_DebugFlag);
COPY_FLAG(verbose, Py_VerboseFlag);
COPY_FLAG(quiet, Py_QuietFlag);
#ifdef MS_WINDOWS
Expand Down Expand Up @@ -1714,7 +1711,6 @@ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
COPY_FLAG(inspect, Py_InspectFlag);
COPY_FLAG(interactive, Py_InteractiveFlag);
COPY_FLAG(optimization_level, Py_OptimizeFlag);
COPY_FLAG(parser_debug, Py_DebugFlag);
COPY_FLAG(verbose, Py_VerboseFlag);
COPY_FLAG(quiet, Py_QuietFlag);
#ifdef MS_WINDOWS
Expand Down
1 change: 0 additions & 1 deletion 1 Tools/c-analyzer/cpython/ignored.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ Python/preconfig.c - _Py_HasFileSystemDefaultEncodeErrors -

## legacy config flags
Python/initconfig.c - Py_UTF8Mode -
Python/initconfig.c - Py_DebugFlag -
Python/initconfig.c - Py_VerboseFlag -
Python/initconfig.c - Py_QuietFlag -
Python/initconfig.c - Py_InteractiveFlag -
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.