Skip to content

Commit 3c902a3

Browse files
author
github-actions[bot]
committed
[3.12] gh-100228: Document the os.fork threads DeprecationWarning. (GH-109767) (#109773)
* gh-100228: Document the os.fork threads DeprecationWarning. (GH-109767) Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs. Many reviews and doc cleanup edits by Adam & Hugo. 🥳 (cherry picked from commit 5e7ea95d9d5c3b80a67ffbeebd76ce4fc327dd8e) Co-authored-by: Gregory P. Smith <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> * link to the discussion thread from whatsnew Include the link to the discussion in the what's new text per @malemberg's comment on. python/cpython#109767 (i'll follow up with a PR to main to include this edit there as well) --------- Co-authored-by: Gregory P. Smith <[email protected]> Co-authored-by: Adam Turner <[email protected]> Co-authored-by: Hugo van Kemenade <[email protected]> CPython-sync-commit: 62df559448362f9a4291661d64aee30474dec025
1 parent 0414abb commit 3c902a3

File tree

4 files changed

+1317
-1281
lines changed

4 files changed

+1317
-1281
lines changed

.pot/library/concurrent.futures.pot

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2023-06-21 00:18+0200\n"
11+
"POT-Creation-Date: 2023-09-24 21:54+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -201,197 +201,201 @@ msgstr ""
201201
msgid "The *max_tasks_per_child* argument was added to allow users to control the lifetime of workers in the pool."
202202
msgstr ""
203203

204-
#: ../../library/concurrent.futures.rst:299
204+
#: ../../library/concurrent.futures.rst:296
205+
msgid "On POSIX systems, if your application has multiple threads and the :mod:`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os.fork` function called internally to spawn workers may raise a :exc:`DeprecationWarning`. Pass a *mp_context* configured to use a different start method. See the :func:`os.fork` documentation for further explanation."
206+
msgstr ""
207+
208+
#: ../../library/concurrent.futures.rst:307
205209
msgid "ProcessPoolExecutor Example"
206210
msgstr ""
207211

208-
#: ../../library/concurrent.futures.rst:337
212+
#: ../../library/concurrent.futures.rst:345
209213
msgid "Future Objects"
210214
msgstr ""
211215

212-
#: ../../library/concurrent.futures.rst:339
216+
#: ../../library/concurrent.futures.rst:347
213217
msgid "The :class:`Future` class encapsulates the asynchronous execution of a callable. :class:`Future` instances are created by :meth:`Executor.submit`."
214218
msgstr ""
215219

216-
#: ../../library/concurrent.futures.rst:344
220+
#: ../../library/concurrent.futures.rst:352
217221
msgid "Encapsulates the asynchronous execution of a callable. :class:`Future` instances are created by :meth:`Executor.submit` and should not be created directly except for testing."
218222
msgstr ""
219223

220-
#: ../../library/concurrent.futures.rst:350
224+
#: ../../library/concurrent.futures.rst:358
221225
msgid "Attempt to cancel the call. If the call is currently being executed or finished running and cannot be cancelled then the method will return ``False``, otherwise the call will be cancelled and the method will return ``True``."
222226
msgstr ""
223227

224-
#: ../../library/concurrent.futures.rst:357
228+
#: ../../library/concurrent.futures.rst:365
225229
msgid "Return ``True`` if the call was successfully cancelled."
226230
msgstr ""
227231

228-
#: ../../library/concurrent.futures.rst:361
232+
#: ../../library/concurrent.futures.rst:369
229233
msgid "Return ``True`` if the call is currently being executed and cannot be cancelled."
230234
msgstr ""
231235

232-
#: ../../library/concurrent.futures.rst:366
236+
#: ../../library/concurrent.futures.rst:374
233237
msgid "Return ``True`` if the call was successfully cancelled or finished running."
234238
msgstr ""
235239

236-
#: ../../library/concurrent.futures.rst:371
240+
#: ../../library/concurrent.futures.rst:379
237241
msgid "Return the value returned by the call. If the call hasn't yet completed then this method will wait up to *timeout* seconds. If the call hasn't completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time."
238242
msgstr ""
239243

240-
#: ../../library/concurrent.futures.rst:378
241-
#: ../../library/concurrent.futures.rst:392
244+
#: ../../library/concurrent.futures.rst:386
245+
#: ../../library/concurrent.futures.rst:400
242246
msgid "If the future is cancelled before completing then :exc:`.CancelledError` will be raised."
243247
msgstr ""
244248

245-
#: ../../library/concurrent.futures.rst:381
249+
#: ../../library/concurrent.futures.rst:389
246250
msgid "If the call raised an exception, this method will raise the same exception."
247251
msgstr ""
248252

249-
#: ../../library/concurrent.futures.rst:385
253+
#: ../../library/concurrent.futures.rst:393
250254
msgid "Return the exception raised by the call. If the call hasn't yet completed then this method will wait up to *timeout* seconds. If the call hasn't completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time."
251255
msgstr ""
252256

253-
#: ../../library/concurrent.futures.rst:395
257+
#: ../../library/concurrent.futures.rst:403
254258
msgid "If the call completed without raising, ``None`` is returned."
255259
msgstr ""
256260

257-
#: ../../library/concurrent.futures.rst:399
261+
#: ../../library/concurrent.futures.rst:407
258262
msgid "Attaches the callable *fn* to the future. *fn* will be called, with the future as its only argument, when the future is cancelled or finishes running."
259263
msgstr ""
260264

261-
#: ../../library/concurrent.futures.rst:403
265+
#: ../../library/concurrent.futures.rst:411
262266
msgid "Added callables are called in the order that they were added and are always called in a thread belonging to the process that added them. If the callable raises an :exc:`Exception` subclass, it will be logged and ignored. If the callable raises a :exc:`BaseException` subclass, the behavior is undefined."
263267
msgstr ""
264268

265-
#: ../../library/concurrent.futures.rst:409
269+
#: ../../library/concurrent.futures.rst:417
266270
msgid "If the future has already completed or been cancelled, *fn* will be called immediately."
267271
msgstr ""
268272

269-
#: ../../library/concurrent.futures.rst:412
273+
#: ../../library/concurrent.futures.rst:420
270274
msgid "The following :class:`Future` methods are meant for use in unit tests and :class:`Executor` implementations."
271275
msgstr ""
272276

273-
#: ../../library/concurrent.futures.rst:417
277+
#: ../../library/concurrent.futures.rst:425
274278
msgid "This method should only be called by :class:`Executor` implementations before executing the work associated with the :class:`Future` and by unit tests."
275279
msgstr ""
276280

277-
#: ../../library/concurrent.futures.rst:421
281+
#: ../../library/concurrent.futures.rst:429
278282
msgid "If the method returns ``False`` then the :class:`Future` was cancelled, i.e. :meth:`Future.cancel` was called and returned ``True``. Any threads waiting on the :class:`Future` completing (i.e. through :func:`as_completed` or :func:`wait`) will be woken up."
279283
msgstr ""
280284

281-
#: ../../library/concurrent.futures.rst:426
285+
#: ../../library/concurrent.futures.rst:434
282286
msgid "If the method returns ``True`` then the :class:`Future` was not cancelled and has been put in the running state, i.e. calls to :meth:`Future.running` will return ``True``."
283287
msgstr ""
284288

285-
#: ../../library/concurrent.futures.rst:430
289+
#: ../../library/concurrent.futures.rst:438
286290
msgid "This method can only be called once and cannot be called after :meth:`Future.set_result` or :meth:`Future.set_exception` have been called."
287291
msgstr ""
288292

289-
#: ../../library/concurrent.futures.rst:436
293+
#: ../../library/concurrent.futures.rst:444
290294
msgid "Sets the result of the work associated with the :class:`Future` to *result*."
291295
msgstr ""
292296

293-
#: ../../library/concurrent.futures.rst:439
294-
#: ../../library/concurrent.futures.rst:452
297+
#: ../../library/concurrent.futures.rst:447
298+
#: ../../library/concurrent.futures.rst:460
295299
msgid "This method should only be used by :class:`Executor` implementations and unit tests."
296300
msgstr ""
297301

298-
#: ../../library/concurrent.futures.rst:442
299-
#: ../../library/concurrent.futures.rst:455
302+
#: ../../library/concurrent.futures.rst:450
303+
#: ../../library/concurrent.futures.rst:463
300304
msgid "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:`Future` is already done."
301305
msgstr ""
302306

303-
#: ../../library/concurrent.futures.rst:449
307+
#: ../../library/concurrent.futures.rst:457
304308
msgid "Sets the result of the work associated with the :class:`Future` to the :class:`Exception` *exception*."
305309
msgstr ""
306310

307-
#: ../../library/concurrent.futures.rst:461
311+
#: ../../library/concurrent.futures.rst:469
308312
msgid "Module Functions"
309313
msgstr ""
310314

311-
#: ../../library/concurrent.futures.rst:465
315+
#: ../../library/concurrent.futures.rst:473
312316
msgid "Wait for the :class:`Future` instances (possibly created by different :class:`Executor` instances) given by *fs* to complete. Duplicate futures given to *fs* are removed and will be returned only once. Returns a named 2-tuple of sets. The first set, named ``done``, contains the futures that completed (finished or cancelled futures) before the wait completed. The second set, named ``not_done``, contains the futures that did not complete (pending or running futures)."
313317
msgstr ""
314318

315-
#: ../../library/concurrent.futures.rst:473
319+
#: ../../library/concurrent.futures.rst:481
316320
msgid "*timeout* can be used to control the maximum number of seconds to wait before returning. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time."
317321
msgstr ""
318322

319-
#: ../../library/concurrent.futures.rst:477
323+
#: ../../library/concurrent.futures.rst:485
320324
msgid "*return_when* indicates when this function should return. It must be one of the following constants:"
321325
msgstr ""
322326

323-
#: ../../library/concurrent.futures.rst:483
327+
#: ../../library/concurrent.futures.rst:491
324328
msgid "Constant"
325329
msgstr ""
326330

327-
#: ../../library/concurrent.futures.rst:483
331+
#: ../../library/concurrent.futures.rst:491
328332
msgid "Description"
329333
msgstr ""
330334

331-
#: ../../library/concurrent.futures.rst:485
335+
#: ../../library/concurrent.futures.rst:493
332336
msgid ":const:`FIRST_COMPLETED`"
333337
msgstr ""
334338

335-
#: ../../library/concurrent.futures.rst:485
339+
#: ../../library/concurrent.futures.rst:493
336340
msgid "The function will return when any future finishes or is cancelled."
337341
msgstr ""
338342

339-
#: ../../library/concurrent.futures.rst:488
343+
#: ../../library/concurrent.futures.rst:496
340344
msgid ":const:`FIRST_EXCEPTION`"
341345
msgstr ""
342346

343-
#: ../../library/concurrent.futures.rst:488
347+
#: ../../library/concurrent.futures.rst:496
344348
msgid "The function will return when any future finishes by raising an exception. If no future raises an exception then it is equivalent to :const:`ALL_COMPLETED`."
345349
msgstr ""
346350

347-
#: ../../library/concurrent.futures.rst:494
351+
#: ../../library/concurrent.futures.rst:502
348352
msgid ":const:`ALL_COMPLETED`"
349353
msgstr ""
350354

351-
#: ../../library/concurrent.futures.rst:494
355+
#: ../../library/concurrent.futures.rst:502
352356
msgid "The function will return when all futures finish or are cancelled."
353357
msgstr ""
354358

355-
#: ../../library/concurrent.futures.rst:500
359+
#: ../../library/concurrent.futures.rst:508
356360
msgid "Returns an iterator over the :class:`Future` instances (possibly created by different :class:`Executor` instances) given by *fs* that yields futures as they complete (finished or cancelled futures). Any futures given by *fs* that are duplicated will be returned once. Any futures that completed before :func:`as_completed` is called will be yielded first. The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is called and the result isn't available after *timeout* seconds from the original call to :func:`as_completed`. *timeout* can be an int or float. If *timeout* is not specified or ``None``, there is no limit to the wait time."
357361
msgstr ""
358362

359-
#: ../../library/concurrent.futures.rst:514
363+
#: ../../library/concurrent.futures.rst:522
360364
msgid ":pep:`3148` -- futures - execute computations asynchronously"
361365
msgstr ""
362366

363-
#: ../../library/concurrent.futures.rst:514
367+
#: ../../library/concurrent.futures.rst:522
364368
msgid "The proposal which described this feature for inclusion in the Python standard library."
365369
msgstr ""
366370

367-
#: ../../library/concurrent.futures.rst:519
371+
#: ../../library/concurrent.futures.rst:527
368372
msgid "Exception classes"
369373
msgstr ""
370374

371-
#: ../../library/concurrent.futures.rst:525
375+
#: ../../library/concurrent.futures.rst:533
372376
msgid "Raised when a future is cancelled."
373377
msgstr ""
374378

375-
#: ../../library/concurrent.futures.rst:529
379+
#: ../../library/concurrent.futures.rst:537
376380
msgid "A deprecated alias of :exc:`TimeoutError`, raised when a future operation exceeds the given timeout."
377381
msgstr ""
378382

379-
#: ../../library/concurrent.futures.rst:534
383+
#: ../../library/concurrent.futures.rst:542
380384
msgid "This class was made an alias of :exc:`TimeoutError`."
381385
msgstr ""
382386

383-
#: ../../library/concurrent.futures.rst:539
387+
#: ../../library/concurrent.futures.rst:547
384388
msgid "Derived from :exc:`RuntimeError`, this exception class is raised when an executor is broken for some reason, and cannot be used to submit or execute new tasks."
385389
msgstr ""
386390

387-
#: ../../library/concurrent.futures.rst:547
391+
#: ../../library/concurrent.futures.rst:555
388392
msgid "Raised when an operation is performed on a future that is not allowed in the current state."
389393
msgstr ""
390394

391-
#: ../../library/concurrent.futures.rst:556
395+
#: ../../library/concurrent.futures.rst:564
392396
msgid "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class is raised when one of the workers of a :class:`ThreadPoolExecutor` has failed initializing."
393397
msgstr ""
394398

395-
#: ../../library/concurrent.futures.rst:566
399+
#: ../../library/concurrent.futures.rst:574
396400
msgid "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:`RuntimeError`), this exception class is raised when one of the workers of a :class:`ProcessPoolExecutor` has terminated in a non-clean fashion (for example, if it was killed from the outside)."
397401
msgstr ""

0 commit comments

Comments
 (0)