8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.11\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
- "POT-Creation-Date : 2022-12-07 00:17 +0000\n "
11
+ "POT-Creation-Date : 2023-01-11 00:15 +0000\n "
12
12
"PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE\n "
13
13
"Last-Translator : FULL NAME <EMAIL@ADDRESS>\n "
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -145,47 +145,47 @@ msgstr ""
145
145
msgid "On Windows, :class:`ProactorEventLoop` is now used by default."
146
146
msgstr ""
147
147
148
- #: ../../library/asyncio-policy.rst:115
148
+ #: ../../library/asyncio-policy.rst:116
149
149
msgid ""
150
- ":meth:`get_event_loop` now emits a :exc:`DeprecationWarning` if there is no "
151
- "current event loop set and a new event loop has been implicitly created. In "
152
- "Python 3.12 it will be an error."
150
+ "In Python versions 3.10.9, 3.11.1 and 3.12 this function emits a :exc: "
151
+ "`DeprecationWarning` if there is no running event loop and no current loop "
152
+ "is set. In some future Python release this will become an error."
153
153
msgstr ""
154
154
155
- #: ../../library/asyncio-policy.rst:123
155
+ #: ../../library/asyncio-policy.rst:124
156
156
msgid ""
157
157
"An alternative event loop policy that uses the :class:`SelectorEventLoop` "
158
158
"event loop implementation."
159
159
msgstr ""
160
160
161
- #: ../../library/asyncio-policy.rst:126 ../../library/asyncio-policy.rst:134
161
+ #: ../../library/asyncio-policy.rst:127 ../../library/asyncio-policy.rst:135
162
162
msgid ":ref:`Availability <availability>`: Windows."
163
163
msgstr ":ref:`適用 <availability>`:Windows。"
164
164
165
- #: ../../library/asyncio-policy.rst:131
165
+ #: ../../library/asyncio-policy.rst:132
166
166
msgid ""
167
167
"An alternative event loop policy that uses the :class:`ProactorEventLoop` "
168
168
"event loop implementation."
169
169
msgstr ""
170
170
171
- #: ../../library/asyncio-policy.rst:140
171
+ #: ../../library/asyncio-policy.rst:141
172
172
msgid "Process Watchers"
173
173
msgstr ""
174
174
175
- #: ../../library/asyncio-policy.rst:142
175
+ #: ../../library/asyncio-policy.rst:143
176
176
msgid ""
177
177
"A process watcher allows customization of how an event loop monitors child "
178
178
"processes on Unix. Specifically, the event loop needs to know when a child "
179
179
"process has exited."
180
180
msgstr ""
181
181
182
- #: ../../library/asyncio-policy.rst:146
182
+ #: ../../library/asyncio-policy.rst:147
183
183
msgid ""
184
184
"In asyncio, child processes are created with :func:`create_subprocess_exec` "
185
185
"and :meth:`loop.subprocess_exec` functions."
186
186
msgstr ""
187
187
188
- #: ../../library/asyncio-policy.rst:150
188
+ #: ../../library/asyncio-policy.rst:151
189
189
msgid ""
190
190
"asyncio defines the :class:`AbstractChildWatcher` abstract base class, which "
191
191
"child watchers should implement, and has four different implementations: :"
@@ -194,176 +194,176 @@ msgid ""
194
194
"`FastChildWatcher`."
195
195
msgstr ""
196
196
197
- #: ../../library/asyncio-policy.rst:156
197
+ #: ../../library/asyncio-policy.rst:157
198
198
msgid ""
199
199
"See also the :ref:`Subprocess and Threads <asyncio-subprocess-threads>` "
200
200
"section."
201
201
msgstr ""
202
202
203
- #: ../../library/asyncio-policy.rst:159
203
+ #: ../../library/asyncio-policy.rst:160
204
204
msgid ""
205
205
"The following two functions can be used to customize the child process "
206
206
"watcher implementation used by the asyncio event loop:"
207
207
msgstr ""
208
208
209
- #: ../../library/asyncio-policy.rst:164
209
+ #: ../../library/asyncio-policy.rst:165
210
210
msgid "Return the current child watcher for the current policy."
211
211
msgstr ""
212
212
213
- #: ../../library/asyncio-policy.rst:168
213
+ #: ../../library/asyncio-policy.rst:169
214
214
msgid ""
215
215
"Set the current child watcher to *watcher* for the current policy. "
216
216
"*watcher* must implement methods defined in the :class:"
217
217
"`AbstractChildWatcher` base class."
218
218
msgstr ""
219
219
220
- #: ../../library/asyncio-policy.rst:173
220
+ #: ../../library/asyncio-policy.rst:174
221
221
msgid ""
222
222
"Third-party event loops implementations might not support custom child "
223
223
"watchers. For such event loops, using :func:`set_child_watcher` might be "
224
224
"prohibited or have no effect."
225
225
msgstr ""
226
226
227
- #: ../../library/asyncio-policy.rst:181
227
+ #: ../../library/asyncio-policy.rst:182
228
228
msgid "Register a new child handler."
229
229
msgstr ""
230
230
231
- #: ../../library/asyncio-policy.rst:183
231
+ #: ../../library/asyncio-policy.rst:184
232
232
msgid ""
233
233
"Arrange for ``callback(pid, returncode, *args)`` to be called when a process "
234
234
"with PID equal to *pid* terminates. Specifying another callback for the "
235
235
"same process replaces the previous handler."
236
236
msgstr ""
237
237
238
- #: ../../library/asyncio-policy.rst:188
238
+ #: ../../library/asyncio-policy.rst:189
239
239
msgid "The *callback* callable must be thread-safe."
240
240
msgstr ""
241
241
242
- #: ../../library/asyncio-policy.rst:192
242
+ #: ../../library/asyncio-policy.rst:193
243
243
msgid "Removes the handler for process with PID equal to *pid*."
244
244
msgstr ""
245
245
246
- #: ../../library/asyncio-policy.rst:194
246
+ #: ../../library/asyncio-policy.rst:195
247
247
msgid ""
248
248
"The function returns ``True`` if the handler was successfully removed, "
249
249
"``False`` if there was nothing to remove."
250
250
msgstr ""
251
251
252
- #: ../../library/asyncio-policy.rst:199
252
+ #: ../../library/asyncio-policy.rst:200
253
253
msgid "Attach the watcher to an event loop."
254
254
msgstr ""
255
255
256
- #: ../../library/asyncio-policy.rst:201
256
+ #: ../../library/asyncio-policy.rst:202
257
257
msgid ""
258
258
"If the watcher was previously attached to an event loop, then it is first "
259
259
"detached before attaching to the new loop."
260
260
msgstr ""
261
261
262
- #: ../../library/asyncio-policy.rst:204
262
+ #: ../../library/asyncio-policy.rst:205
263
263
msgid "Note: loop may be ``None``."
264
264
msgstr ""
265
265
266
- #: ../../library/asyncio-policy.rst:208
266
+ #: ../../library/asyncio-policy.rst:209
267
267
msgid "Return ``True`` if the watcher is ready to use."
268
268
msgstr ""
269
269
270
- #: ../../library/asyncio-policy.rst:210
270
+ #: ../../library/asyncio-policy.rst:211
271
271
msgid ""
272
272
"Spawning a subprocess with *inactive* current child watcher raises :exc:"
273
273
"`RuntimeError`."
274
274
msgstr ""
275
275
276
- #: ../../library/asyncio-policy.rst:217
276
+ #: ../../library/asyncio-policy.rst:218
277
277
msgid "Close the watcher."
278
278
msgstr ""
279
279
280
- #: ../../library/asyncio-policy.rst:219
280
+ #: ../../library/asyncio-policy.rst:220
281
281
msgid ""
282
282
"This method has to be called to ensure that underlying resources are cleaned-"
283
283
"up."
284
284
msgstr ""
285
285
286
- #: ../../library/asyncio-policy.rst:224
286
+ #: ../../library/asyncio-policy.rst:225
287
287
msgid ""
288
288
"This implementation starts a new waiting thread for every subprocess spawn."
289
289
msgstr ""
290
290
291
- #: ../../library/asyncio-policy.rst:226
291
+ #: ../../library/asyncio-policy.rst:227
292
292
msgid ""
293
293
"It works reliably even when the asyncio event loop is run in a non-main OS "
294
294
"thread."
295
295
msgstr ""
296
296
297
- #: ../../library/asyncio-policy.rst:228
297
+ #: ../../library/asyncio-policy.rst:229
298
298
msgid ""
299
299
"There is no noticeable overhead when handling a big number of children "
300
300
"(*O(1)* each time a child terminates), but starting a thread per process "
301
301
"requires extra memory."
302
302
msgstr ""
303
303
304
- #: ../../library/asyncio-policy.rst:231
304
+ #: ../../library/asyncio-policy.rst:232
305
305
msgid "This watcher is used by default."
306
306
msgstr ""
307
307
308
- #: ../../library/asyncio-policy.rst:237
308
+ #: ../../library/asyncio-policy.rst:238
309
309
msgid ""
310
310
"This implementation registers a :py:data:`SIGCHLD` signal handler on "
311
311
"instantiation. That can break third-party code that installs a custom "
312
312
"handler for :py:data:`SIGCHLD` signal."
313
313
msgstr ""
314
314
315
- #: ../../library/asyncio-policy.rst:241 ../../library/asyncio-policy.rst:259
315
+ #: ../../library/asyncio-policy.rst:242 ../../library/asyncio-policy.rst:260
316
316
msgid ""
317
317
"The watcher avoids disrupting other code spawning processes by polling every "
318
318
"process explicitly on a :py:data:`SIGCHLD` signal."
319
319
msgstr ""
320
320
321
- #: ../../library/asyncio-policy.rst:244
321
+ #: ../../library/asyncio-policy.rst:245
322
322
msgid ""
323
323
"There is no limitation for running subprocesses from different threads once "
324
324
"the watcher is installed."
325
325
msgstr ""
326
326
327
- #: ../../library/asyncio-policy.rst:247
327
+ #: ../../library/asyncio-policy.rst:248
328
328
msgid ""
329
329
"The solution is safe but it has a significant overhead when handling a big "
330
330
"number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)."
331
331
msgstr ""
332
332
333
- #: ../../library/asyncio-policy.rst:255
333
+ #: ../../library/asyncio-policy.rst:256
334
334
msgid ""
335
335
"This implementation uses active event loop from the main thread to handle :"
336
336
"py:data:`SIGCHLD` signal. If the main thread has no running event loop "
337
337
"another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)."
338
338
msgstr ""
339
339
340
- #: ../../library/asyncio-policy.rst:262
340
+ #: ../../library/asyncio-policy.rst:263
341
341
msgid ""
342
342
"This solution is as safe as :class:`MultiLoopChildWatcher` and has the same "
343
343
"*O(N)* complexity but requires a running event loop in the main thread to "
344
344
"work."
345
345
msgstr ""
346
346
347
- #: ../../library/asyncio-policy.rst:267
347
+ #: ../../library/asyncio-policy.rst:268
348
348
msgid ""
349
349
"This implementation reaps every terminated processes by calling ``os."
350
350
"waitpid(-1)`` directly, possibly breaking other code spawning processes and "
351
351
"waiting for their termination."
352
352
msgstr ""
353
353
354
- #: ../../library/asyncio-policy.rst:271
354
+ #: ../../library/asyncio-policy.rst:272
355
355
msgid ""
356
356
"There is no noticeable overhead when handling a big number of children "
357
357
"(*O(1)* each time a child terminates)."
358
358
msgstr ""
359
359
360
- #: ../../library/asyncio-policy.rst:274
360
+ #: ../../library/asyncio-policy.rst:275
361
361
msgid ""
362
362
"This solution requires a running event loop in the main thread to work, as :"
363
363
"class:`SafeChildWatcher`."
364
364
msgstr ""
365
365
366
- #: ../../library/asyncio-policy.rst:279
366
+ #: ../../library/asyncio-policy.rst:280
367
367
msgid ""
368
368
"This implementation polls process file descriptors (pidfds) to await child "
369
369
"process termination. In some respects, :class:`PidfdChildWatcher` is a "
@@ -374,11 +374,11 @@ msgid ""
374
374
"only work on recent (5.3+) kernels."
375
375
msgstr ""
376
376
377
- #: ../../library/asyncio-policy.rst:293
377
+ #: ../../library/asyncio-policy.rst:294
378
378
msgid "Custom Policies"
379
379
msgstr ""
380
380
381
- #: ../../library/asyncio-policy.rst:295
381
+ #: ../../library/asyncio-policy.rst:296
382
382
msgid ""
383
383
"To implement a new event loop policy, it is recommended to subclass :class:"
384
384
"`DefaultEventLoopPolicy` and override the methods for which custom behavior "
0 commit comments