-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathasyncio-dev.po
More file actions
429 lines (358 loc) · 12.8 KB
/
asyncio-dev.po
File metadata and controls
429 lines (358 loc) · 12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2017, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2017.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-23 11:56+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.5.1\n"
#: ../Doc/library/asyncio-dev.rst:6
msgid "Develop with asyncio"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:8
msgid ""
"Asynchronous programming is different than classical \"sequential\" "
"programming. This page lists common traps and explains how to avoid them."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:15
msgid "Debug mode of asyncio"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:17
msgid ""
"The implementation of :mod:`asyncio` has been written for performance. In"
" order to ease the development of asynchronous code, you may wish to "
"enable *debug mode*."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:21
msgid "To enable all debug checks for an application:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:23
msgid ""
"Enable the asyncio debug mode globally by setting the environment "
"variable :envvar:`PYTHONASYNCIODEBUG` to ``1``, or by calling "
":meth:`AbstractEventLoop.set_debug`."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:25
msgid ""
"Set the log level of the :ref:`asyncio logger <asyncio-logger>` to "
":py:data:`logging.DEBUG`. For example, call "
"``logging.basicConfig(level=logging.DEBUG)`` at startup."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:28
msgid ""
"Configure the :mod:`warnings` module to display :exc:`ResourceWarning` "
"warnings. For example, use the ``-Wdefault`` command line option of "
"Python to display them."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:32
msgid "Examples debug checks:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:34
msgid ""
"Log :ref:`coroutines defined but never \"yielded from\" <asyncio-"
"coroutine-not-scheduled>`"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:36
msgid ""
":meth:`~AbstractEventLoop.call_soon` and "
":meth:`~AbstractEventLoop.call_at` methods raise an exception if they are"
" called from the wrong thread."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:38
msgid "Log the execution time of the selector"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:39
msgid ""
"Log callbacks taking more than 100 ms to be executed. The "
":attr:`AbstractEventLoop.slow_callback_duration` attribute is the minimum"
" duration in seconds of \"slow\" callbacks."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:42
msgid ""
":exc:`ResourceWarning` warnings are emitted when transports and event "
"loops are :ref:`not closed explicitly <asyncio-close-transports>`."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:47
msgid ""
"The :meth:`AbstractEventLoop.set_debug` method and the :ref:`asyncio "
"logger <asyncio-logger>`."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:52
msgid "Cancellation"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:54
msgid ""
"Cancellation of tasks is not common in classic programming. In "
"asynchronous programming, not only is it something common, but you have "
"to prepare your code to handle it."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:58
msgid ""
"Futures and tasks can be cancelled explicitly with their "
":meth:`Future.cancel` method. The :func:`wait_for` function cancels the "
"waited task when the timeout occurs. There are many other cases where a "
"task can be cancelled indirectly."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:62
msgid ""
"Don't call :meth:`~Future.set_result` or :meth:`~Future.set_exception` "
"method of :class:`Future` if the future is cancelled: it would fail with "
"an exception. For example, write::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:69
msgid ""
"Don't schedule directly a call to the :meth:`~Future.set_result` or the "
":meth:`~Future.set_exception` method of a future with "
":meth:`AbstractEventLoop.call_soon`: the future can be cancelled before "
"its method is called."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:74
msgid ""
"If you wait for a future, you should check early if the future was "
"cancelled to avoid useless operations. Example::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:85
msgid "The :func:`shield` function can also be used to ignore cancellation."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:91
msgid "Concurrency and multithreading"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:93
msgid ""
"An event loop runs in a thread and executes all callbacks and tasks in "
"the same thread. While a task is running in the event loop, no other task"
" is running in the same thread. But when the task uses ``yield from``, "
"the task is suspended and the event loop executes the next task."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:98
msgid ""
"To schedule a callback from a different thread, the "
":meth:`AbstractEventLoop.call_soon_threadsafe` method should be used. "
"Example::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:103
msgid ""
"Most asyncio objects are not thread safe. You should only worry if you "
"access objects outside the event loop. For example, to cancel a future, "
"don't call directly its :meth:`Future.cancel` method, but::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:109
msgid ""
"To handle signals and to execute subprocesses, the event loop must be run"
" in the main thread."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:112
msgid ""
"To schedule a coroutine object from a different thread, the "
":func:`run_coroutine_threadsafe` function should be used. It returns a "
":class:`concurrent.futures.Future` to access the result::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:119
msgid ""
"The :meth:`AbstractEventLoop.run_in_executor` method can be used with a "
"thread pool executor to execute a callback in different thread to not "
"block the thread of the event loop."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:125
msgid ""
"The :ref:`Synchronization primitives <asyncio-sync>` section describes "
"ways to synchronize tasks."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:128
msgid ""
"The :ref:`Subprocess and threads <asyncio-subprocess-threads>` section "
"lists asyncio limitations to run subprocesses from different threads."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:137
msgid "Handle blocking functions correctly"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:139
msgid ""
"Blocking functions should not be called directly. For example, if a "
"function blocks for 1 second, other tasks are delayed by 1 second which "
"can have an important impact on reactivity."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:143
msgid ""
"For networking and subprocesses, the :mod:`asyncio` module provides high-"
"level APIs like :ref:`protocols <asyncio-protocol>`."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:146
msgid ""
"An executor can be used to run a task in a different thread or even in a "
"different process, to not block the thread of the event loop. See the "
":meth:`AbstractEventLoop.run_in_executor` method."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:152
msgid ""
"The :ref:`Delayed calls <asyncio-delayed-calls>` section details how the "
"event loop handles time."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:159
msgid "Logging"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:161
msgid ""
"The :mod:`asyncio` module logs information with the :mod:`logging` module"
" in the logger ``'asyncio'``."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:164
msgid ""
"The default log level for the :mod:`asyncio` module is "
":py:data:`logging.INFO`. For those not wanting such verbosity from "
":mod:`asyncio` the log level can be changed. For example, to change the "
"level to :py:data:`logging.WARNING`:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:176
msgid "Detect coroutine objects never scheduled"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:178
msgid ""
"When a coroutine function is called and its result is not passed to "
":func:`ensure_future` or to the :meth:`AbstractEventLoop.create_task` "
"method, the execution of the coroutine object will never be scheduled "
"which is probably a bug. :ref:`Enable the debug mode of asyncio "
"<asyncio-debug-mode>` to :ref:`log a warning <asyncio-logger>` to detect "
"it."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:184
msgid "Example with the bug::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:194
msgid "Output in debug mode::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:201
msgid ""
"The fix is to call the :func:`ensure_future` function or the "
":meth:`AbstractEventLoop.create_task` method with the coroutine object."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:206
msgid ":ref:`Pending task destroyed <asyncio-pending-task-destroyed>`."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:210
msgid "Detect exceptions never consumed"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:212
msgid ""
"Python usually calls :func:`sys.excepthook` on unhandled exceptions. If "
":meth:`Future.set_exception` is called, but the exception is never "
"consumed, :func:`sys.excepthook` is not called. Instead, :ref:`a log is "
"emitted <asyncio-logger>` when the future is deleted by the garbage "
"collector, with the traceback where the exception was raised."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:218
msgid "Example of unhandled exception::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:231
msgid "Output::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:244
msgid ""
":ref:`Enable the debug mode of asyncio <asyncio-debug-mode>` to get the "
"traceback where the task was created. Output in debug mode::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:263
msgid ""
"There are different options to fix this issue. The first option is to "
"chain the coroutine in another coroutine and use classic try/except::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:278
msgid ""
"Another option is to use the :meth:`AbstractEventLoop.run_until_complete`"
" function::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:289
msgid "The :meth:`Future.exception` method."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:293
msgid "Chain coroutines correctly"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:295
msgid ""
"When a coroutine function calls other coroutine functions and tasks, they"
" should be chained explicitly with ``yield from``. Otherwise, the "
"execution is not guaranteed to be sequential."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:299
msgid ""
"Example with different bugs using :func:`asyncio.sleep` to simulate slow "
"operations::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:332
msgid "Expected output:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:341
msgid "Actual output:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:351
msgid ""
"The loop stopped before the ``create()`` finished, ``close()`` has been "
"called before ``write()``, whereas coroutine functions were called in "
"this order: ``create()``, ``write()``, ``close()``."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:355
msgid "To fix the example, tasks must be marked with ``yield from``::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:365
msgid "Or without ``asyncio.ensure_future()``::"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:379
msgid "Pending task destroyed"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:381
msgid ""
"If a pending task is destroyed, the execution of its wrapped "
":ref:`coroutine <coroutine>` did not complete. It is probably a bug and "
"so a warning is logged."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:384
msgid "Example of log:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:391
msgid ""
":ref:`Enable the debug mode of asyncio <asyncio-debug-mode>` to get the "
"traceback where the task was created. Example of log in debug mode:"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:405
msgid ""
":ref:`Detect coroutine objects never scheduled <asyncio-coroutine-not-"
"scheduled>`."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:410
msgid "Close transports and event loops"
msgstr ""
#: ../Doc/library/asyncio-dev.rst:412
msgid ""
"When a transport is no more needed, call its ``close()`` method to "
"release resources. Event loops must also be closed explicitly."
msgstr ""
#: ../Doc/library/asyncio-dev.rst:415
msgid ""
"If a transport or an event loop is not closed explicitly, a "
":exc:`ResourceWarning` warning will be emitted in its destructor. By "
"default, :exc:`ResourceWarning` warnings are ignored. The :ref:`Debug "
"mode of asyncio <asyncio-debug-mode>` section explains how to display "
"them."
msgstr ""
#~ msgid ""
#~ "Python usually calls :func:`sys.displayhook` "
#~ "on unhandled exceptions. If "
#~ ":meth:`Future.set_exception` is called, but "
#~ "the exception is never consumed, "
#~ ":func:`sys.displayhook` is not called. "
#~ "Instead, :ref:`a log is emitted "
#~ "<asyncio-logger>` when the future is "
#~ "deleted by the garbage collector, with"
#~ " the traceback where the exception "
#~ "was raised."
#~ msgstr ""