@@ -38,6 +38,15 @@ msgid ""
38
38
"pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` "
39
39
"functions return ``1`` for success and ``0`` for failure)."
40
40
msgstr ""
41
+ "この章で説明する関数を使うと、 Python の例外の処理や例外の送出ができるように"
42
+ "なります。 Python の例外処理の基本をいくらか理解することが大切です。例外は "
43
+ "POSIX :c:data:`errno` 変数にやや似た機能を果たします: 発生した中で最も新しい"
44
+ "エラーの (スレッド毎の) グローバルなインジケータがあります。実行に成功した場"
45
+ "合にはほとんどの C API 関数がこれをクリアしませんが、失敗したときにはエラーの"
46
+ "原因を示すために設定します。ほとんどの C API 関数はエラーインジケータも返し、"
47
+ "通常は関数がポインタを返すことになっている場合は ``NULL`` であり、関数が整数"
48
+ "を返す場合は ``-1`` です。(例外: ``PyArg_*`` 関数は実行に成功したときに "
49
+ "``1`` を返し、失敗したときに ``0`` を返します)."
41
50
42
51
#: ../../c-api/exceptions.rst:20
43
52
msgid ""
@@ -106,6 +115,11 @@ msgid ""
106
115
"printed and the Python process will exit with the error code specified by "
107
116
"the ``SystemExit`` instance."
108
117
msgstr ""
118
+ "標準のトレースバックを ``sys.stderr`` に出力し、エラーインジケータをクリアし"
119
+ "ます。\n"
120
+ "ただし、エラーが ``SystemExit`` **である場合を除いて** です。\n"
121
+ "その場合、トレースバックは出力されず、 Python プロセスは ``SystemExit`` イン"
122
+ "スタンスで指定されたエラーコードで終了します。"
109
123
110
124
#: ../../c-api/exceptions.rst:60
111
125
msgid ""
@@ -183,6 +197,10 @@ msgid ""
183
197
"count. The second argument is an error message; it is decoded from "
184
198
"``'utf-8'``."
185
199
msgstr ""
200
+ "これはエラーインジケータを設定するための最も一般的な方法です。第一引数は例外"
201
+ "の型を指定します。通常は標準例外の一つ、例えば :c:data:`PyExc_RuntimeError` "
202
+ "です。その参照カウントを増加させる必要はありません。第二引数はエラーメッセー"
203
+ "ジで、 ``'utf-8'`` からデコードされます。"
186
204
187
205
#: ../../c-api/exceptions.rst:108
188
206
msgid ""
@@ -289,6 +307,10 @@ msgid ""
289
307
"is given as a C string. *filename* is decoded from the :term:`filesystem "
290
308
"encoding and error handler`."
291
309
msgstr ""
310
+ ":c:func:`PyErr_SetFromErrnoWithFilenameObject` に似ていますが、ファイル名は "
311
+ "C 文字列として与えられます。\n"
312
+ "*filename* は :term:`ファイルシステムのエンコーディングとエラーハンドラ "
313
+ "<filesystem encoding and error handler>` でデコードされます。"
292
314
293
315
#: ../../c-api/exceptions.rst:191
294
316
msgid ""
@@ -302,6 +324,14 @@ msgid ""
302
324
"``PyErr_SetObject(PyExc_WindowsError, object)``. This function always "
303
325
"returns ``NULL``."
304
326
msgstr ""
327
+ "これは :exc:`WindowsError` を発生させるために便利な関数です。 ``0`` の "
328
+ "*ierr* とともに呼び出された場合、 :c:func:`GetLastError` が返すエラーコードが"
329
+ "代りに使われます。 *ierr* あるいは :c:func:`GetLastError` によって与えられる"
330
+ "エラーコードのWindows用の説明を取り出すために、Win32関数 :c:func:"
331
+ "`FormatMessage` を呼び出します。それから、第一要素が *ierr* 値で第二要素が(:"
332
+ "c:func:`FormatMessage` から得られる) 対応するエラーメッセージであるタプルオブ"
333
+ "ジェクトを構成します。そして、 ``PyErr_SetObject(PyExc_WindowsError, "
334
+ "object)`` を呼び出します。この関数は常に ``NULL`` を返します。"
305
335
306
336
#: ../../c-api/exceptions.rst:200 ../../c-api/exceptions.rst:208
307
337
#: ../../c-api/exceptions.rst:217 ../../c-api/exceptions.rst:225
@@ -388,12 +418,17 @@ msgid ""
388
418
"Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string "
389
419
"decoded from the :term:`filesystem encoding and error handler`."
390
420
msgstr ""
421
+ ":c:func:`PyErr_SyntaxLocationObject` と似ていますが、 *filename* は :term:`"
422
+ "ファイルシステムのエンコーディングとエラーハンドラ <filesystem encoding and "
423
+ "error handler>` でデコードされたバイト文字列です。"
391
424
392
425
#: ../../c-api/exceptions.rst:284
393
426
msgid ""
394
427
"Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is "
395
428
"omitted."
396
429
msgstr ""
430
+ ":c:func:`PyErr_SyntaxLocationEx` と似ていますが、 *col_offset* 引数が除去され"
431
+ "ています。"
397
432
398
433
#: ../../c-api/exceptions.rst:290
399
434
msgid ""
@@ -486,13 +521,21 @@ msgid ""
486
521
"warn_explicit`; see there for more information. The *module* and *registry* "
487
522
"arguments may be set to ``NULL`` to get the default effect described there."
488
523
msgstr ""
524
+ "すべての警告の属性を明示的に制御した警告メッセージを出します。これは Python "
525
+ "関数 :func:`warnings.warn_explicit` の直接的なラッパーで、さらに情報を得るに"
526
+ "はそちらを参照してください。そこに説明されているデフォルトの効果を得るため"
527
+ "に、 *module* と *registry* 引数は ``NULL`` に設定することができます。"
489
528
490
529
#: ../../c-api/exceptions.rst:345
491
530
msgid ""
492
531
"Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and "
493
532
"*module* are UTF-8 encoded strings, and *filename* is decoded from the :term:"
494
533
"`filesystem encoding and error handler`."
495
534
msgstr ""
535
+ ":c:func:`PyErr_WarnExplicitObject` に似ていますが、 *message* と *module* が "
536
+ "UTF-8 エンコードされた文字列であるところが異なり、 *filename* は :term:`ファ"
537
+ "イルシステムのエンコーディングとエラーハンドラ <filesystem encoding and "
538
+ "error handler>` でデコードされます。"
496
539
497
540
#: ../../c-api/exceptions.rst:352
498
541
msgid ""
@@ -525,6 +568,11 @@ msgid ""
525
568
"do not own a reference to the return value, so you do not need to :c:func:"
526
569
"`Py_DECREF` it."
527
570
msgstr ""
571
+ "エラーインジケータが設定されているかテストします。設定されている場合は、例外"
572
+ "の *型* (``PyErr_Set*`` 関数の一つあるいは :c:func:`PyErr_Restore` への最も新"
573
+ "しい呼び出しに対する第一引数)を返します。設定されていない場合は ``NULL`` を返"
574
+ "します。あなたは戻り値への参照を持っていませんので、それに :c:func:"
575
+ "`Py_DECREF` する必要はありません。"
528
576
529
577
#: ../../c-api/exceptions.rst:378
530
578
msgid "The caller must hold the GIL."
@@ -762,6 +810,9 @@ msgid ""
762
810
"`PyErr_CheckSignals` is called, the Python signal handler for the given "
763
811
"signal number will be called."
764
812
msgstr ""
813
+ "シグナルが到達した効果をシミュレートします。\n"
814
+ "次に :c:func:`PyErr_CheckSignals` が呼ばれたとき、与えられたシグナル番号用の "
815
+ "Python のシグナルハンドラが呼び出されます。"
765
816
766
817
#: ../../c-api/exceptions.rst:558
767
818
msgid ""
@@ -776,6 +827,8 @@ msgid ""
776
827
"If the given signal isn't handled by Python (it was set to :data:`signal."
777
828
"SIG_DFL` or :data:`signal.SIG_IGN`), it will be ignored."
778
829
msgstr ""
830
+ "与えられたシグナルが Python に対処されなかった (:data:`signal.SIG_DFL` また"
831
+ "は :data:`signal.SIG_IGN` に設定されていた) 場合、無視されます。"
779
832
780
833
#: ../../c-api/exceptions.rst:566
781
834
msgid ""
@@ -1085,6 +1138,9 @@ msgid ""
1085
1138
"to be concatenated to the :exc:`RecursionError` message caused by the "
1086
1139
"recursion depth limit."
1087
1140
msgstr ""
1141
+ "*where* は ``\" in instance check\" `` のような UTF-8 エンコードされた文字列に"
1142
+ "して、再帰の深さの限界に達したことで送出される :exc:`RecursionError` のメッ"
1143
+ "セージに連結できるようにすべきです。"
1088
1144
1089
1145
#: ../../c-api/exceptions.rst:783 ../../c-api/exceptions.rst:791
1090
1146
msgid "This function is now also available in the limited API."
@@ -1169,6 +1225,9 @@ msgid ""
1169
1225
"c:expr:`PyObject*`; they are all class objects. For completeness, here are "
1170
1226
"all the variables:"
1171
1227
msgstr ""
1228
+ "``PyExc_`` の後ろにPythonの例外名が続く名前をもつグローバル変数として、すべて"
1229
+ "の標準Python例外が利用可能です。これらは型 :c:expr:`PyObject*` を持ち、すべて"
1230
+ "クラスオブジェクトです。完璧を期するために、すべての変数を以下に列挙します:"
1172
1231
1173
1232
#: ../../c-api/exceptions.rst:890 ../../c-api/exceptions.rst:1023
1174
1233
#: ../../c-api/exceptions.rst:1068
@@ -1694,6 +1753,10 @@ msgid ""
1694
1753
"the type :c:expr:`PyObject*`; they are all class objects. For completeness, "
1695
1754
"here are all the variables:"
1696
1755
msgstr ""
1756
+ "``PyExc_`` の後ろにPythonの例外名が続く名前をもつグローバル変数として、すべて"
1757
+ "の標準Python警告カテゴリが利用可能です。これらは型 :c:expr:`PyObject*` を持"
1758
+ "ち、すべてクラスオブジェクトです。完璧を期するために、すべての変数を以下に列"
1759
+ "挙します:"
1697
1760
1698
1761
#: ../../c-api/exceptions.rst:1070
1699
1762
msgid ":c:data:`PyExc_Warning`"
0 commit comments