@@ -6,13 +6,14 @@ msgstr ""
66"Project-Id-Version : Python 3\n "
77"Report-Msgid-Bugs-To : \n "
88"POT-Creation-Date : 2020-10-01 16:00+0200\n "
9- "PO-Revision-Date : 2018-10-13 17:38+0200 \n "
10- "Last-Translator : Julien Palard <julien@palard.fr >\n "
9+ "PO-Revision-Date : 2022-06-06 21:29-0400 \n "
10+ "Last-Translator : Nicolas Haller <nicolas@haller.im >\n "
1111"Language-Team : FRENCH <traductions@lists.afpy.org>\n "
1212"Language : fr\n "
1313"MIME-Version : 1.0\n "
1414"Content-Type : text/plain; charset=UTF-8\n "
1515"Content-Transfer-Encoding : 8bit\n "
16+ "X-Generator : Poedit 3.0.1\n "
1617
1718#: library/asyncio-dev.rst:7
1819msgid "Developing with asyncio"
@@ -23,94 +24,125 @@ msgid ""
2324"Asynchronous programming is different from classic \" sequential\" "
2425"programming."
2526msgstr ""
27+ "La programmation asynchrone est différente de la programmation "
28+ "« séquentielle » classique."
2629
2730#: library/asyncio-dev.rst:12
2831msgid ""
2932"This page lists common mistakes and traps and explains how to avoid them."
3033msgstr ""
34+ "Cette page liste les pièges et erreurs communs que le développeur pourrait "
35+ "rencontrer et décrit comment les éviter."
3136
3237#: library/asyncio-dev.rst:19
3338msgid "Debug Mode"
34- msgstr ""
39+ msgstr "Mode débogage "
3540
3641#: library/asyncio-dev.rst:21
3742msgid ""
3843"By default asyncio runs in production mode. In order to ease the "
3944"development asyncio has a *debug mode*."
4045msgstr ""
46+ "Par défaut, *asyncio* s'exécute en mode production. Pour faciliter le "
47+ "développement, *asyncio* possède un « mode débogage »."
4148
4249#: library/asyncio-dev.rst:24
4350msgid "There are several ways to enable asyncio debug mode:"
44- msgstr ""
51+ msgstr "Il existe plusieurs façons d'activer le mode débogage de *asyncio* : "
4552
4653#: library/asyncio-dev.rst:26
4754msgid "Setting the :envvar:`PYTHONASYNCIODEBUG` environment variable to ``1``."
4855msgstr ""
56+ "en réglant la variable d’environnement :envvar:`PYTHONASYNCIODEBUG` à ``1`` ;"
4957
5058#: library/asyncio-dev.rst:28
5159msgid "Using the :ref:`Python Development Mode <devmode>`."
5260msgstr ""
61+ "en utilisant le mode développement de Python (:ref:`Python Development Mode "
62+ "<devmode>`) ;"
5363
5464#: library/asyncio-dev.rst:30
5565msgid "Passing ``debug=True`` to :func:`asyncio.run`."
56- msgstr ""
66+ msgstr "en passant ``debug=True`` à la fonction :func:`asyncio.run` ; "
5767
5868#: library/asyncio-dev.rst:32
5969msgid "Calling :meth:`loop.set_debug`."
60- msgstr ""
70+ msgstr "en appelant la méthode :meth:`loop.set_debug`. "
6171
6272#: library/asyncio-dev.rst:34
6373msgid "In addition to enabling the debug mode, consider also:"
64- msgstr ""
74+ msgstr "En plus d'activer le mode débogage, vous pouvez également : "
6575
6676#: library/asyncio-dev.rst:36
6777msgid ""
6878"setting the log level of the :ref:`asyncio logger <asyncio-logger>` to :py:"
6979"data:`logging.DEBUG`, for example the following snippet of code can be run "
7080"at startup of the application::"
7181msgstr ""
82+ "régler le niveau de journalisation pour l'enregistreur d'*asyncio* (:ref:"
83+ "`asyncio logger <asyncio-logger>`) à :py:data:`logging.DEBUG` ; par exemple, "
84+ "le fragment de code suivant peut être exécuté au démarrage de "
85+ "l'application ::"
7286
7387#: library/asyncio-dev.rst:42
7488msgid ""
7589"configuring the :mod:`warnings` module to display :exc:`ResourceWarning` "
7690"warnings. One way of doing that is by using the :option:`-W` ``default`` "
7791"command line option."
7892msgstr ""
93+ "configurer le module :mod:`warnings` afin d'afficher les avertissements de "
94+ "type :exc:`ResourceWarning` ; vous pouvez faire cela en utilisant l'option :"
95+ "option:`-W` ``default`` sur la ligne de commande."
7996
8097#: library/asyncio-dev.rst:47
8198msgid "When the debug mode is enabled:"
82- msgstr ""
99+ msgstr "Lorsque le mode débogage est activé : "
83100
101+ # long ref
84102#: library/asyncio-dev.rst:49
85103msgid ""
86104"asyncio checks for :ref:`coroutines that were not awaited <asyncio-coroutine-"
87105"not-scheduled>` and logs them; this mitigates the \" forgotten await\" "
88106"pitfall."
89107msgstr ""
108+ "*asyncio* surveille les :ref:`coroutines qui ne sont jamais attendues "
109+ "<asyncio-coroutine-not-scheduled>` et les journalise ; cela atténue le "
110+ "problème des « *await* oubliés » ;"
90111
112+ # thread safe comment traduire
91113#: library/asyncio-dev.rst:53
92114msgid ""
93115"Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:"
94116"`loop.call_at` methods) raise an exception if they are called from a wrong "
95117"thread."
96118msgstr ""
119+ "beaucoup d'*API* *asyncio* ne prenant pas en charge les fils d'exécution "
120+ "multiples (comme les méthodes :meth:`loop.call_soon` et :meth:`loop."
121+ "call_at`) lèvent une exception si elles sont appelées par le mauvais fil "
122+ "d’exécution ;"
97123
98124#: library/asyncio-dev.rst:57
99125msgid ""
100126"The execution time of the I/O selector is logged if it takes too long to "
101127"perform an I/O operation."
102128msgstr ""
129+ "le temps d'exécution du sélecteur d'entrée-sortie est journalisé si une "
130+ "opération prend trop de temps à s'effectuer ;"
103131
104132#: library/asyncio-dev.rst:60
105133msgid ""
106134"Callbacks taking longer than 100ms are logged. The :attr:`loop."
107135"slow_callback_duration` attribute can be used to set the minimum execution "
108136"duration in seconds that is considered \" slow\" ."
109137msgstr ""
138+ "les fonctions de rappel prenant plus de 100 ms sont journalisées ; "
139+ "l'attribut :attr:`loop.slow_callback_duration` peut être utilisé pour "
140+ "changer la limite (en secondes) après laquelle une fonction de rappel est "
141+ "considérée comme « lent »."
110142
111143#: library/asyncio-dev.rst:68
112144msgid "Concurrency and Multithreading"
113- msgstr "Concourance et *multithreading* "
145+ msgstr "Programmation concurrente et multi-fils "
114146
115147#: library/asyncio-dev.rst:70
116148msgid ""
@@ -120,12 +152,21 @@ msgid ""
120152"``await`` expression, the running Task gets suspended, and the event loop "
121153"executes the next Task."
122154msgstr ""
155+ "Une boucle d'évènements s'exécute dans un fil d’exécution (typiquement dans "
156+ "le fil principal) et traite toutes les fonctions de rappel (*callbacks*) "
157+ "ainsi que toutes les tâches dans ce même fil. Lorsqu'une tâche est en cours "
158+ "d'exécution dans la boucle d'évènements, aucune autre tâche ne peut "
159+ "s'exécuter dans ce fil. Quand une tâche traite une expression ``await``, "
160+ "elle se suspend et laisse la boucle d’évènements traiter la tâche suivante."
123161
124162#: library/asyncio-dev.rst:76
125163msgid ""
126164"To schedule a :term:`callback` from another OS thread, the :meth:`loop."
127165"call_soon_threadsafe` method should be used. Example::"
128166msgstr ""
167+ "Pour planifier un :term:`rappel <callback>` depuis un autre fil d'exécution "
168+ "système, utilisez la méthode :meth:`loop.call_soon_threadsafe`. Par "
169+ "exemple ::"
129170
130171#: library/asyncio-dev.rst:81
131172msgid ""
@@ -134,19 +175,30 @@ msgid ""
134175"a callback. If there's a need for such code to call a low-level asyncio "
135176"API, the :meth:`loop.call_soon_threadsafe` method should be used, e.g.::"
136177msgstr ""
178+ "La plupart des objets *asyncio* ne sont pas conçus pour être exécutés dans "
179+ "un contexte multi-fils (*thread-safe*) mais cela n'est en général pas un "
180+ "problème à moins que l'objet ne fasse appel à du code se trouvant en dehors "
181+ "d'une tâche ou d'une fonction de rappel. Dans ce dernier cas, si le code "
182+ "appelle les *API* bas niveau de *asyncio*, utilisez la méthode :meth:`loop."
183+ "call_soon_threadsafe`. Par exemple ::"
137184
138185#: library/asyncio-dev.rst:89
139186msgid ""
140187"To schedule a coroutine object from a different OS thread, the :func:"
141188"`run_coroutine_threadsafe` function should be used. It returns a :class:"
142189"`concurrent.futures.Future` to access the result::"
143190msgstr ""
191+ "Pour planifier un objet concurrent depuis un autre fil d'exécution système, "
192+ "utilisez :func:`run_coroutine_threadsafe`. Cette fonction renvoie un objet :"
193+ "class:`concurrent.futures.Future` pour accéder au résultat ::"
144194
145195#: library/asyncio-dev.rst:102
146196msgid ""
147197"To handle signals and to execute subprocesses, the event loop must be run in "
148198"the main thread."
149199msgstr ""
200+ "Pour pouvoir traiter les signaux et démarrer des processus enfants, la "
201+ "boucle d'évènements doit être exécutée dans le fil principal."
150202
151203#: library/asyncio-dev.rst:105
152204msgid ""
@@ -155,6 +207,10 @@ msgid ""
155207"different OS thread without blocking the OS thread that the event loop runs "
156208"in."
157209msgstr ""
210+ "La méthode :meth:`loop.run_in_executor` peut être utilisée avec :class:"
211+ "`concurrent.futures.ThreadPoolExecutor` pour exécuter du code bloquant dans "
212+ "un autre fil d'exécution, afin de ne pas bloquer le fil où la boucle "
213+ "d'évènements se trouve."
158214
159215#: library/asyncio-dev.rst:110
160216msgid ""
@@ -168,24 +224,44 @@ msgid ""
168224"a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a "
169225"different process."
170226msgstr ""
227+ "Il n'y a actuellement aucune façon de planifier des coroutines ou des "
228+ "rappels directement depuis un autre processus (comme, par exemple, un "
229+ "processus démarré avec :mod:`multiprocessing`). La section :ref:`Méthodes de "
230+ "la boucle d'évènements <asyncio-event-loop>` liste les *API* pouvant lire "
231+ "les tubes (*pipes*) et surveiller les descripteurs de fichiers sans bloquer "
232+ "la boucle d'évènements. De plus, les *API* :ref:`Subprocess <asyncio-"
233+ "subprocess>` d'*asyncio* fournissent un moyen de démarrer un processus et de "
234+ "communiquer avec lui depuis la boucle d'évènements. Enfin, la méthode :meth:"
235+ "`loop.run_in_executor` peut également être utilisée avec :class:`concurrent."
236+ "futures.ProcessPoolExecutor` pour exécuter du code dans un processus "
237+ "différent."
171238
172239#: library/asyncio-dev.rst:124
173240msgid "Running Blocking Code"
174- msgstr ""
241+ msgstr "Exécution de code bloquant "
175242
176243#: library/asyncio-dev.rst:126
177244msgid ""
178245"Blocking (CPU-bound) code should not be called directly. For example, if a "
179246"function performs a CPU-intensive calculation for 1 second, all concurrent "
180247"asyncio Tasks and IO operations would be delayed by 1 second."
181248msgstr ""
249+ "Du code bloquant sur des opérations de calcul (*CPU-bound*) ne devrait pas "
250+ "être appelé directement. Par exemple, si une fonction effectue des calculs "
251+ "utilisant le CPU intensivement pendant une seconde, toutes les tâches "
252+ "*asyncio* concurrentes et les opérations d'entrées-sorties seront bloquées "
253+ "pour une seconde."
182254
183255#: library/asyncio-dev.rst:131
184256msgid ""
185257"An executor can be used to run a task in a different thread or even in a "
186258"different process to avoid blocking the OS thread with the event loop. See "
187259"the :meth:`loop.run_in_executor` method for more details."
188260msgstr ""
261+ "Un exécuteur peut être utilisé pour traiter une tâche dans un fil "
262+ "d'exécution ou un processus différent, afin d'éviter de bloquer le fil "
263+ "d'exécution système dans lequel se trouve la boucle d’évènements. Voir :meth:"
264+ "`loop.run_in_executor` pour plus de détails."
189265
190266#: library/asyncio-dev.rst:140
191267msgid "Logging"
@@ -196,23 +272,31 @@ msgid ""
196272"asyncio uses the :mod:`logging` module and all logging is performed via the "
197273"``\" asyncio\" `` logger."
198274msgstr ""
275+ "*Asyncio* utilise le module :mod:`logging`. Toutes les opérations de "
276+ "journalisation sont effectuées via l'enregistreur (*logger*) ``\" asyncio\" ``."
199277
200278#: library/asyncio-dev.rst:145
201279msgid ""
202280"The default log level is :py:data:`logging.INFO`, which can be easily "
203281"adjusted::"
204282msgstr ""
283+ "Le niveau de journalisation par défaut est :py:data:`logging.INFO` mais peut "
284+ "être ajusté facilement ::"
205285
206286#: library/asyncio-dev.rst:154
207287msgid "Detect never-awaited coroutines"
208- msgstr ""
288+ msgstr "Détection des coroutines jamais attendues "
209289
210290#: library/asyncio-dev.rst:156
211291msgid ""
212292"When a coroutine function is called, but not awaited (e.g. ``coro()`` "
213293"instead of ``await coro()``) or the coroutine is not scheduled with :meth:"
214294"`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::"
215295msgstr ""
296+ "Lorsqu'une fonction coroutine est appelée mais qu'elle n'est pas attendue "
297+ "(p. ex. ``coro()`` au lieu de ``await coro()``) ou si la coroutine n'est "
298+ "pas planifiée avec :meth:`asyncio.create_task`, *asyncio* émet un :exc:"
299+ "`RuntimeWarning` ::"
216300
217301#: library/asyncio-dev.rst:216
218302msgid "Output::"
@@ -227,10 +311,12 @@ msgid ""
227311"The usual fix is to either await the coroutine or call the :meth:`asyncio."
228312"create_task` function::"
229313msgstr ""
314+ "La façon habituelle de régler ce problème est d'attendre (*await*) la "
315+ "coroutine ou bien d'appeler la fonction :meth:`asyncio.create_task` ::"
230316
231317#: library/asyncio-dev.rst:197
232318msgid "Detect never-retrieved exceptions"
233- msgstr ""
319+ msgstr "Détection des exceptions jamais récupérées "
234320
235321#: library/asyncio-dev.rst:199
236322msgid ""
@@ -239,13 +325,19 @@ msgid ""
239325"this case, asyncio would emit a log message when the Future object is "
240326"garbage collected."
241327msgstr ""
328+ "Si la méthode :meth:`Future.set_exception` est appelée mais que l'objet "
329+ "*Future* n'est pas attendu, l'exception n'est pas propagée au code "
330+ "utilisateur. Dans ce cas, *asyncio* écrit un message dans le journal lorsque "
331+ "l'objet *Future* est récupéré par le ramasse-miette."
242332
243333#: library/asyncio-dev.rst:204
244334msgid "Example of an unhandled exception::"
245- msgstr ""
335+ msgstr "Exemple d'une exception non-gérée :: "
246336
247337#: library/asyncio-dev.rst:227
248338msgid ""
249339":ref:`Enable the debug mode <asyncio-debug-mode>` to get the traceback where "
250340"the task was created::"
251341msgstr ""
342+ ":ref:`Activez le mode débogage <asyncio-debug-mode>` pour récupérer la trace "
343+ "d'appels indiquant où la tâche a été créée ::"
0 commit comments