@@ -83,74 +83,133 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
83
83
84
84
.. c :var :: int Py_BytesWarningFlag
85
85
86
+ This API is kept for backward compatibility: setting
87
+ :c:member: `PyConfig.bytes_warning ` should be used instead, see :ref: `Python
88
+ Initialization Configuration <init-config>`.
89
+
86
90
Issue a warning when comparing :class: `bytes ` or :class: `bytearray ` with
87
91
:class: `str ` or :class: `bytes ` with :class: `int `. Issue an error if greater
88
92
or equal to ``2 ``.
89
93
90
94
Set by the :option: `-b ` option.
91
95
96
+ .. deprecated :: 3.12
97
+
92
98
.. c :var :: int Py_DebugFlag
93
99
100
+ This API is kept for backward compatibility: setting
101
+ :c:member: `PyConfig.parser_debug ` should be used instead, see :ref: `Python
102
+ Initialization Configuration <init-config>`.
103
+
94
104
Turn on parser debugging output (for expert only, depending on compilation
95
105
options).
96
106
97
107
Set by the :option: `-d ` option and the :envvar: `PYTHONDEBUG ` environment
98
108
variable.
99
109
110
+ .. deprecated :: 3.12
111
+
100
112
.. c :var :: int Py_DontWriteBytecodeFlag
101
113
114
+ This API is kept for backward compatibility: setting
115
+ :c:member: `PyConfig.write_bytecode ` should be used instead, see :ref: `Python
116
+ Initialization Configuration <init-config>`.
117
+
102
118
If set to non-zero, Python won't try to write ``.pyc `` files on the
103
119
import of source modules.
104
120
105
121
Set by the :option: `-B ` option and the :envvar: `PYTHONDONTWRITEBYTECODE `
106
122
environment variable.
107
123
124
+ .. deprecated :: 3.12
125
+
108
126
.. c :var :: int Py_FrozenFlag
109
127
128
+ This API is kept for backward compatibility: setting
129
+ :c:member: `PyConfig.pathconfig_warnings ` should be used instead, see
130
+ :ref: `Python Initialization Configuration <init-config >`.
131
+
110
132
Suppress error messages when calculating the module search path in
111
133
:c:func: `Py_GetPath `.
112
134
113
135
Private flag used by ``_freeze_module `` and ``frozenmain `` programs.
114
136
137
+ .. deprecated :: 3.12
138
+
115
139
.. c :var :: int Py_HashRandomizationFlag
116
140
141
+ This API is kept for backward compatibility: setting
142
+ :c:member: `PyConfig.hash_seed ` and :c:member: `PyConfig.use_hash_seed ` should
143
+ be used instead, see :ref: `Python Initialization Configuration
144
+ <init-config>`.
145
+
117
146
Set to ``1 `` if the :envvar: `PYTHONHASHSEED ` environment variable is set to
118
147
a non-empty string.
119
148
120
149
If the flag is non-zero, read the :envvar: `PYTHONHASHSEED ` environment
121
150
variable to initialize the secret hash seed.
122
151
152
+ .. deprecated :: 3.12
153
+
123
154
.. c :var :: int Py_IgnoreEnvironmentFlag
124
155
156
+ This API is kept for backward compatibility: setting
157
+ :c:member: `PyConfig.use_environment ` should be used instead, see
158
+ :ref: `Python Initialization Configuration <init-config >`.
159
+
125
160
Ignore all :envvar: `PYTHON* ` environment variables, e.g.
126
161
:envvar: `PYTHONPATH ` and :envvar: `PYTHONHOME `, that might be set.
127
162
128
163
Set by the :option: `-E ` and :option: `-I ` options.
129
164
165
+ .. deprecated :: 3.12
166
+
130
167
.. c :var :: int Py_InspectFlag
131
168
169
+ This API is kept for backward compatibility: setting
170
+ :c:member: `PyConfig.inspect ` should be used instead, see
171
+ :ref: `Python Initialization Configuration <init-config >`.
172
+
132
173
When a script is passed as first argument or the :option: `-c ` option is used,
133
174
enter interactive mode after executing the script or the command, even when
134
175
:data: `sys.stdin ` does not appear to be a terminal.
135
176
136
177
Set by the :option: `-i ` option and the :envvar: `PYTHONINSPECT ` environment
137
178
variable.
138
179
180
+ .. deprecated :: 3.12
181
+
139
182
.. c :var :: int Py_InteractiveFlag
140
183
184
+ This API is kept for backward compatibility: setting
185
+ :c:member: `PyConfig.interactive ` should be used instead, see
186
+ :ref: `Python Initialization Configuration <init-config >`.
187
+
141
188
Set by the :option: `-i ` option.
142
189
190
+ .. deprecated :: 3.12
191
+
143
192
.. c :var :: int Py_IsolatedFlag
144
193
194
+ This API is kept for backward compatibility: setting
195
+ :c:member: `PyConfig.isolated ` should be used instead, see
196
+ :ref: `Python Initialization Configuration <init-config >`.
197
+
145
198
Run Python in isolated mode. In isolated mode :data: `sys.path ` contains
146
199
neither the script's directory nor the user's site-packages directory.
147
200
148
201
Set by the :option: `-I ` option.
149
202
150
203
.. versionadded :: 3.4
151
204
205
+ .. deprecated :: 3.12
206
+
152
207
.. c :var :: int Py_LegacyWindowsFSEncodingFlag
153
208
209
+ This API is kept for backward compatibility: setting
210
+ :c:member: `PyPreConfig.legacy_windows_fs_encoding ` should be used instead, see
211
+ :ref: `Python Initialization Configuration <init-config >`.
212
+
154
213
If the flag is non-zero, use the ``mbcs `` encoding with ``replace `` error
155
214
handler, instead of the UTF-8 encoding with ``surrogatepass `` error handler,
156
215
for the :term: `filesystem encoding and error handler `.
@@ -162,8 +221,14 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
162
221
163
222
.. availability :: Windows.
164
223
224
+ .. deprecated :: 3.12
225
+
165
226
.. c :var :: int Py_LegacyWindowsStdioFlag
166
227
228
+ This API is kept for backward compatibility: setting
229
+ :c:member: `PyConfig.legacy_windows_stdio ` should be used instead, see
230
+ :ref: `Python Initialization Configuration <init-config >`.
231
+
167
232
If the flag is non-zero, use :class: `io.FileIO ` instead of
168
233
:class: `WindowsConsoleIO ` for :mod: `sys ` standard streams.
169
234
@@ -174,45 +239,81 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
174
239
175
240
.. availability :: Windows.
176
241
242
+ .. deprecated :: 3.12
243
+
177
244
.. c :var :: int Py_NoSiteFlag
178
245
246
+ This API is kept for backward compatibility: setting
247
+ :c:member: `PyConfig.site_import ` should be used instead, see
248
+ :ref: `Python Initialization Configuration <init-config >`.
249
+
179
250
Disable the import of the module :mod: `site ` and the site-dependent
180
251
manipulations of :data: `sys.path ` that it entails. Also disable these
181
252
manipulations if :mod: `site ` is explicitly imported later (call
182
253
:func: `site.main ` if you want them to be triggered).
183
254
184
255
Set by the :option: `-S ` option.
185
256
257
+ .. deprecated :: 3.12
258
+
186
259
.. c :var :: int Py_NoUserSiteDirectory
187
260
261
+ This API is kept for backward compatibility: setting
262
+ :c:member: `PyConfig.user_site_directory ` should be used instead, see
263
+ :ref: `Python Initialization Configuration <init-config >`.
264
+
188
265
Don't add the :data: `user site-packages directory <site.USER_SITE> ` to
189
266
:data: `sys.path `.
190
267
191
268
Set by the :option: `-s ` and :option: `-I ` options, and the
192
269
:envvar: `PYTHONNOUSERSITE ` environment variable.
193
270
271
+ .. deprecated :: 3.12
272
+
194
273
.. c :var :: int Py_OptimizeFlag
195
274
275
+ This API is kept for backward compatibility: setting
276
+ :c:member: `PyConfig.optimization_level ` should be used instead, see
277
+ :ref: `Python Initialization Configuration <init-config >`.
278
+
196
279
Set by the :option: `-O ` option and the :envvar: `PYTHONOPTIMIZE ` environment
197
280
variable.
198
281
282
+ .. deprecated :: 3.12
283
+
199
284
.. c :var :: int Py_QuietFlag
200
285
286
+ This API is kept for backward compatibility: setting
287
+ :c:member: `PyConfig.quiet ` should be used instead, see :ref: `Python
288
+ Initialization Configuration <init-config>`.
289
+
201
290
Don't display the copyright and version messages even in interactive mode.
202
291
203
292
Set by the :option: `-q ` option.
204
293
205
294
.. versionadded :: 3.2
206
295
296
+ .. deprecated :: 3.12
297
+
207
298
.. c :var :: int Py_UnbufferedStdioFlag
208
299
300
+ This API is kept for backward compatibility: setting
301
+ :c:member: `PyConfig.buffered_stdio ` should be used instead, see :ref: `Python
302
+ Initialization Configuration <init-config>`.
303
+
209
304
Force the stdout and stderr streams to be unbuffered.
210
305
211
306
Set by the :option: `-u ` option and the :envvar: `PYTHONUNBUFFERED `
212
307
environment variable.
213
308
309
+ .. deprecated :: 3.12
310
+
214
311
.. c :var :: int Py_VerboseFlag
215
312
313
+ This API is kept for backward compatibility: setting
314
+ :c:member: `PyConfig.verbose ` should be used instead, see :ref: `Python
315
+ Initialization Configuration <init-config>`.
316
+
216
317
Print a message each time a module is initialized, showing the place
217
318
(filename or built-in module) from which it is loaded. If greater or equal
218
319
to ``2 ``, print a message for each file that is checked for when
@@ -221,6 +322,8 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2.
221
322
Set by the :option: `-v ` option and the :envvar: `PYTHONVERBOSE ` environment
222
323
variable.
223
324
325
+ .. deprecated :: 3.12
326
+
224
327
225
328
Initializing and finalizing the interpreter
226
329
===========================================
@@ -253,6 +356,9 @@ Initializing and finalizing the interpreter
253
356
(without calling :c:func: `Py_FinalizeEx ` first). There is no return value; it is a
254
357
fatal error if the initialization fails.
255
358
359
+ Use the :c:func: `Py_InitializeFromConfig ` function to customize the
360
+ :ref: `Python Initialization Configuration <init-config >`.
361
+
256
362
.. note ::
257
363
On Windows, changes the console mode from ``O_TEXT `` to ``O_BINARY ``, which will
258
364
also affect non-Python uses of the console using the C Runtime.
@@ -264,6 +370,9 @@ Initializing and finalizing the interpreter
264
370
*initsigs* is ``0``, it skips initialization registration of signal handlers, which
265
371
might be useful when Python is embedded.
266
372
373
+ Use the :c:func:`Py_InitializeFromConfig` function to customize the
374
+ :ref:`Python Initialization Configuration <init-config>`.
375
+
267
376
268
377
.. c:function:: int Py_IsInitialized()
269
378
0 commit comments