-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathexceptions.po
More file actions
883 lines (609 loc) · 91.9 KB
/
Copy pathexceptions.po
File metadata and controls
883 lines (609 loc) · 91.9 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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Alireza Shabani (Revisto) <theRevisto@gmail.com>, 2025
# Danial Behzadi <dani.behzi@ubuntu.com>, 2025
# Rafael Fontenelle <rffontenelle@gmail.com>, 2025
# Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-16 12:56+0000\n"
"PO-Revision-Date: 2026-09-15 13:22+0330\n"
"Last-Translator: Sepehr Rasouli <sepehrrasouli06@gmail.com>, 2026\n"
"Language-Team: Persian (https://github.com/python/python-docs-fa/)\n"
"Language: fa\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.6\n"
msgid "Exception Handling"
msgstr "مدیریت استثنا"
msgid "The functions described in this chapter will let you handle and raise Python exceptions. It is important to understand some of the basics of Python exception handling. It works somewhat like the POSIX :c:data:`errno` variable: there is a global indicator (per thread) of the last error that occurred. Most C API functions don't clear this on success, but will set it to indicate the cause of the error on failure. Most C API functions also return an error indicator, usually ``NULL`` if they are supposed to return a pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` functions return ``1`` for success and ``0`` for failure)."
msgstr "توابعی که در این فصل توضیح داده شدهاند به شما امکان میدهند تا استثناهای پایتون را مدیریت و برپا کنید. درک برخی از مبانی مدیریت استثنا در پایتون اهمیت دارد. این سازوکار تا حدی مانند متغیر :c:data:`errno` در POSIX کار میکند: یک نشانگر سراسری (به ازای هر نخ) برای آخرین خطای رخداده وجود دارد. بیشتر توابع C API این نشانگر را در صورت موفقیت پاک نمیکنند، اما در صورت شکست آن را برای نشان دادن علت خطا تنظیم میکنند. بیشتر توابع C API همچنین یک نشانگر خطا برمیگردانند؛ معمولاً ``NULL`` اگر قرار باشد اشارهگر برگردانند، یا ``-1`` اگر عدد صحیح برگردانند (استثنا: توابع ``PyArg_*`` برای موفقیت ``1`` و برای شکست ``0`` برمیگردانند)."
msgid "Concretely, the error indicator consists of three object pointers: the exception's type, the exception's value, and the traceback object. Any of those pointers can be ``NULL`` if non-set (although some combinations are forbidden, for example you can't have a non-``NULL`` traceback if the exception type is ``NULL``)."
msgstr "بهطور مشخص، نشانگر خطا از سه اشارهگر شیء تشکیل شده است: نوع استثنا، مقدار استثنا، و شیء ردگیری. هر یک از این اشارهگرها میتواند در صورت تنظیمنشده بودن ``NULL`` باشد (هرچند برخی ترکیبها ممنوع هستند؛ برای مثال، اگر نوع استثنا ``NULL`` باشد، نمیتوانید ردگیریای داشته باشید که ``NULL`` نباشد)."
msgid "When a function must fail because some function it called failed, it generally doesn't set the error indicator; the function it called already set it. It is responsible for either handling the error and clearing the exception or returning after cleaning up any resources it holds (such as object references or memory allocations); it should *not* continue normally if it is not prepared to handle the error. If returning due to an error, it is important to indicate to the caller that an error has been set. If the error is not handled or carefully propagated, additional calls into the Python/C API may not behave as intended and may fail in mysterious ways."
msgstr "وقتی تابعی باید به این دلیل شکست بخورد که تابعی که آن را فراخوانی کرده شکست خورده است، معمولاً نشانگر خطا را تنظیم نمیکند؛ تابع فراخوانیشده قبلاً آن را تنظیم کرده است. مسئولیت این تابع است که یا خطا را مدیریت کند و استثنا را پاک کند، یا پس از پاکسازی هر منبعی که در اختیار دارد (مانند ارجاعهای شیء یا تخصیصهای حافظه) بازگشت کند؛ اگر برای مدیریت خطا آماده نباشد، *نباید* بهصورت عادی ادامه دهد. در صورت بازگشت بهدلیل خطا، مهم است به فراخواننده نشان داده شود که خطایی تنظیم شده است. اگر خطا مدیریت نشود یا بهدقت بالا برده نشود، ممکن است فراخوانیهای بعدی در Python/C API آنگونه که در نظر گرفته شده است رفتار نکنند و به شیوههای مرموز شکست بخورند."
msgid "The error indicator is **not** the result of :func:`sys.exc_info`. The former corresponds to an exception that is not yet caught (and is therefore still propagating), while the latter returns an exception after it is caught (and has therefore stopped propagating)."
msgstr "نشانگر خطا نتیجهی :func:`sys.exc_info` **نیست**. اولی به استثنایی مربوط است که هنوز گرفتهنشده است (و بنابراین همچنان در حال انتشار است)، در حالی که دومی استثنا را پس از گرفتهشدن آن برمیگرداند (و بنابراین انتشار آن متوقف شده است)."
msgid "Printing and clearing"
msgstr "چاپ و پاک کردن"
msgid "Clear the error indicator. If the error indicator is not set, there is no effect."
msgstr "نشانگر خطا را پاک میکند. اگر نشانگر خطا تنظیم نشده باشد، هیچ اثری ندارد."
msgid "Print a standard traceback to ``sys.stderr`` and clear the error indicator. **Unless** the error is a ``SystemExit``, in that case no traceback is printed and the Python process will exit with the error code specified by the ``SystemExit`` instance."
msgstr "یک ردگیری استاندارد در ``sys.stderr`` چاپ میکند و نشانگر خطا را پاک میکند. **مگر اینکه** خطا یک ``SystemExit`` باشد، در این حالت هیچ ردگیریای چاپ نمیشود و فرایند پایتون با کد خطای تعیینشده توسط نمونهی ``SystemExit`` خارج خواهد شد."
msgid "Call this function **only** when the error indicator is set. Otherwise it will cause a fatal error!"
msgstr "این تابع را **فقط** زمانی فراخوانی کنید که نشانگر خطا تنظیم شده باشد. در غیر این صورت، باعث خطای مهلک خواهد شد!"
msgid "If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is set to the printed exception. For backwards compatibility, the deprecated variables :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback` are also set to the type, value and traceback of this exception, respectively."
msgstr "اگر *set_sys_last_vars* ناصفر باشد، متغیر :data:`sys.last_exc` به استثنای چاپشده تنظیم میشود. برای سازگاری با نسخههای پیشین، متغیرهای منسوخ :data:`sys.last_type`، :data:`sys.last_value` و :data:`sys.last_traceback` نیز به ترتیب به نوع، مقدار و ردگیری این استثنا تنظیم میشوند."
msgid "The setting of :data:`sys.last_exc` was added."
msgstr "تنظیم :data:`sys.last_exc` اضافه شد."
msgid "Alias for ``PyErr_PrintEx(1)``."
msgstr "مستعار برای ``PyErr_PrintEx(1)``."
msgid "Call :func:`sys.unraisablehook` using the current exception and *obj* argument."
msgstr ":func:`sys.unraisablehook` را با استفاده از استثنای فعلی و آرگومان *obj* فراخوانی کنید."
msgid "This utility function prints a warning message to ``sys.stderr`` when an exception has been set but it is impossible for the interpreter to actually raise the exception. It is used, for example, when an exception occurs in an :meth:`~object.__del__` method."
msgstr "این تابع کاربردی زمانی که استثنایی تنظیمشده باشد اما برافکندن آن برای مفسر واقعاً ممکن نباشد، یک پیام هشدار در ``sys.stderr`` چاپ میکند. این تابع برای مثال زمانی استفاده میشود که استثنایی در متد :meth:`~object.__del__` رخ دهد."
msgid "The function is called with a single argument *obj* that identifies the context in which the unraisable exception occurred. If possible, the repr of *obj* will be printed in the warning message. If *obj* is ``NULL``, only the traceback is printed."
msgstr "این تابع با یک آرگومان واحد *obj* فراخوانی میشود که زمینهی وقوع استثنای غیرقابلصدور (unraisable exception) را شناسایی میکند. در صورت امکان، repr مربوط به *obj* در پیام هشدار چاپ میشود. اگر *obj* برابر ``NULL`` باشد، فقط ردگیری پشته چاپ میشود."
msgid "An exception must be set when calling this function."
msgstr "هنگام فراخوانی این تابع، باید یک استثنا تنظیم شده باشد."
msgid "Print a traceback. Print only traceback if *obj* is ``NULL``."
msgstr "یک ردگیری پشته چاپ میکند. اگر *obj* برابر ``NULL`` باشد، فقط ردگیری پشته را چاپ میکند."
msgid "Use :func:`sys.unraisablehook`."
msgstr "از :func:`sys.unraisablehook` استفاده کنید."
msgid "Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent parameters help format the warning message; they have the same meaning and values as in :c:func:`PyUnicode_FromFormat`. ``PyErr_WriteUnraisable(obj)`` is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: %R\", obj)``. If *format* is ``NULL``, only the traceback is printed."
msgstr "مشابه :c:func:`PyErr_WriteUnraisable` است، اما *format* و پارامترهای بعدی به قالببندی پیام هشدار کمک میکنند؛ معنا و مقادیر آنها همانند :c:func:`PyUnicode_FromFormat` است. ``PyErr_WriteUnraisable(obj)`` تقریباً معادل ``PyErr_FormatUnraisable(\"Exception ignored in: %R\", obj)`` است. اگر *format* برابر ``NULL`` باشد، فقط ردگیری پشته چاپ میشود."
msgid "Print the standard traceback display of ``exc`` to ``sys.stderr``, including chained exceptions and notes."
msgstr "نمایش استاندارد ردگیری ``exc`` را بههمراه استثناهای زنجیرهشده و یادداشتها در ``sys.stderr`` چاپ میکند."
msgid "Legacy variant of :c:func:`PyErr_DisplayException`."
msgstr "گونهی قدیمیِ :c:func:`PyErr_DisplayException`."
msgid "Print the exception *value* with its traceback to :data:`sys.stderr`. If *value* has no traceback set, *tb* is used as its traceback. The first argument is ignored."
msgstr "مقدار استثنا *value* را همراه با ردگیری آن در :data:`sys.stderr` چاپ میکند. اگر برای *value* هیچ ردگیریای تنظیم نشده باشد، از *tb* بهعنوان ردگیری آن استفاده میشود. آرگومان اول نادیده گرفته میشود."
msgid "If :data:`sys.stderr` is ``None``, nothing is printed. If :data:`sys.stderr` is not set, the exception is dumped to the C ``stderr`` stream instead."
msgstr "اگر :data:`sys.stderr` برابر ``None`` باشد، چیزی چاپ نمیشود. اگر :data:`sys.stderr` تنظیم نشده باشد، استثنا در عوض به جریان ``stderr`` زبان C برونریزی میشود."
msgid "Use :c:func:`PyErr_DisplayException` instead."
msgstr "به جای آن از :c:func:`PyErr_DisplayException` استفاده کنید."
msgid "Raising exceptions"
msgstr "برخاست دادن استثناها"
msgid "These functions help you set the current thread's error indicator. For convenience, some of these functions will always return a ``NULL`` pointer for use in a ``return`` statement."
msgstr "این توابع به شما کمک میکنند نشانگر خطای نخ جاری را تنظیم کنید. برای سهولت، برخی از این توابع همیشه یک اشارهگر ``NULL`` برای استفاده در دستور ``return`` برمیگردانند."
msgid "This is the most common way to set the error indicator. The first argument specifies the exception type; it is normally one of the standard exceptions, e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an error message; it is decoded from ``'utf-8'``."
msgstr "این رایجترین روش برای تنظیم نشانگر خطا است. آرگومان اول نوع استثنا را مشخص میکند؛ این آرگومان معمولاً یکی از استثناهای استاندارد است، برای مثال :c:data:`PyExc_RuntimeError`. لازم نیست :term:`ارجاع قوی <strong reference>` جدیدی به آن ایجاد کنید (مثلاً با :c:func:`Py_INCREF`). آرگومان دوم یک پیام خطا است؛ این پیام از ``'utf-8'`` کدگشایی میشود."
msgid "This function is similar to :c:func:`PyErr_SetString` but lets you specify an arbitrary Python object for the \"value\" of the exception."
msgstr "این تابع مشابه :c:func:`PyErr_SetString` است، اما به شما اجازه میدهد یک شیء دلخواه پایتون را بهعنوان «مقدار» استثنا مشخص کنید."
msgid "This function sets the error indicator and returns ``NULL``. *exception* should be a Python exception class. The *format* and subsequent parameters help format the error message; they have the same meaning and values as in :c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string."
msgstr "این تابع نشانگر خطا را تنظیم میکند و ``NULL`` را برمیگرداند. *exception* باید یک کلاس استثنای پایتون باشد. *format* و پارامترهای بعدی به قالببندی پیام خطا کمک میکنند؛ معنا و مقادیر آنها همانند :c:func:`PyUnicode_FromFormat` است. *format* یک رشته کدگذاریشده با اسکی است."
msgid "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument rather than a variable number of arguments."
msgstr "مانند :c:func:`PyErr_Format` است، اما بهجای تعداد متغیری از آرگومانها، یک آرگومان :c:type:`va_list` میگیرد."
msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``."
msgstr "این یک شکل مختصر برای ``PyErr_SetObject(type, Py_None)`` است."
msgid "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where *message* indicates that a built-in operation was invoked with an illegal argument. It is mostly for internal use."
msgstr "این شکل کوتاهی برای ``PyErr_SetString(PyExc_TypeError, message)`` است، که در آن *message* نشان میدهد که یک عملیات توکار با آرگومانی غیرمجاز فراخوانی شده است. این عمدتاً برای استفادهی داخلی است."
msgid "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns ``NULL`` so an object allocation function can write ``return PyErr_NoMemory();`` when it runs out of memory."
msgstr "این شکل مختصری برای ``PyErr_SetNone(PyExc_MemoryError)`` است؛ این تابع ``NULL`` را برمیگرداند تا یک تابع تخصیص شیء بتواند هنگامی که حافظهاش تمام میشود، ``return PyErr_NoMemory();`` بنویسد."
msgid "This is a convenience function to raise an exception when a C library function has returned an error and set the C variable :c:data:`errno`. It constructs a tuple object whose first item is the integer :c:data:`errno` value and whose second item is the corresponding error message (gotten from :c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, indicating an interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if that set the error indicator, leaves it set to that. The function always returns ``NULL``, so a wrapper function around a system call can write ``return PyErr_SetFromErrno(type);`` when the system call returns an error."
msgstr "این تابع برای راحتی کار فراهم شده است تا در زمانی که یک تابع کتابخانهی C خطا برگردانده و متغیر C یعنی :c:data:`errno` را تنظیم کرده است، یک استثنا پرتاب کند. این تابع یک شیء تاپل میسازد که آیتم نخست آن، مقدار عدد صحیح :c:data:`errno`، و آیتم دوم آن، پیام خطای مربوطه (گرفتهشده از :c:func:`!strerror`) است، و سپس ``PyErr_SetObject(type, object)`` را فراخوانی میکند. در یونیکس، هنگامی که مقدار :c:data:`errno` برابر :c:macro:`!EINTR` باشد (که نشاندهندهی یک فراخوانی سیستمی مختلشده است)، این تابع :c:func:`PyErr_CheckSignals` را فراخوانی میکند و اگر آن تابع نشانگر خطا را تنظیم کرده باشد، آن را به همان صورت تنظیمشده باقی میگذارد. این تابع همیشه ``NULL`` را برمیگرداند، بنابراین یک تابع پوششی حول یک فراخوانی سیستمی میتواند هنگامی که فراخوانی سیستمی خطا برمیگرداند، ``return PyErr_SetFromErrno(type);`` بنویسد."
msgid "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that if *filenameObject* is not ``NULL``, it is passed to the constructor of *type* as a third parameter. In the case of :exc:`OSError` exception, this is used to define the :attr:`!filename` attribute of the exception instance."
msgstr "مشابه :c:func:`PyErr_SetFromErrno`، با این رفتار اضافی که اگر *filenameObject* برابر ``NULL`` نباشد، بهعنوان پارامتر سوم به سازندهی *type* پاس داده میشود. در مورد استثنای :exc:`OSError`، از این برای تعریف ویژگی :attr:`!filename` نمونهی استثنا استفاده میشود."
msgid "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a second filename object, for raising errors when a function that takes two filenames fails."
msgstr "مشابه :c:func:`PyErr_SetFromErrnoWithFilenameObject` است، اما یک شیء نام پروندهی دوم میگیرد تا هنگامی که تابعی که دو نام پرونده میگیرد شکست میخورد، خطاها برافراشته شوند."
msgid "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename is given as a C string. *filename* is decoded from the :term:`filesystem encoding and error handler`."
msgstr "مشابه :c:func:`PyErr_SetFromErrnoWithFilenameObject`، با این تفاوت که نام پرونده بهصورت یک رشتهی C داده میشود. *filename* با استفاده از :term:`filesystem encoding and error handler` کدگشایی میشود."
msgid "This is a convenience function to raise :exc:`OSError`. If called with *ierr* of ``0``, the error code returned by a call to :c:func:`!GetLastError` is used instead. It calls the Win32 function :c:func:`!FormatMessage` to retrieve the Windows description of error code given by *ierr* or :c:func:`!GetLastError`, then it constructs a :exc:`OSError` object with the :attr:`~OSError.winerror` attribute set to the error code, the :attr:`~OSError.strerror` attribute set to the corresponding error message (gotten from :c:func:`!FormatMessage`), and then calls ``PyErr_SetObject(PyExc_OSError, object)``. This function always returns ``NULL``."
msgstr "این یک تابع کمکی برای پرتاب :exc:`OSError` است. اگر با مقدار ``0`` برای *ierr* فراخوانی شود، بهجای آن از کد خطایی که فراخوانی :c:func:`!GetLastError` برمیگرداند استفاده میشود. این تابع برای بازیابی توضیح ویندوز برای کد خطای دادهشده توسط *ierr* یا :c:func:`!GetLastError`، تابع Win32 یعنی :c:func:`!FormatMessage` را فراخوانی میکند؛ سپس یک شیء :exc:`OSError` میسازد که ویژگی :attr:`~OSError.winerror` آن روی کد خطا و ویژگی :attr:`~OSError.strerror` آن روی پیام خطای متناظر (گرفتهشده از :c:func:`!FormatMessage`) تنظیم شدهاند، و سپس ``PyErr_SetObject(PyExc_OSError, object)`` را فراخوانی میکند. این تابع همیشه ``NULL`` را برمیگرداند."
msgid "Availability"
msgstr "دسترسپذیری"
msgid "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter specifying the exception type to be raised."
msgstr "مشابه :c:func:`PyErr_SetFromWindowsErr`، با یک پارامتر اضافی برای تعیین نوع استثنایی که باید ایجاد شود."
msgid "Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior that if *filename* is not ``NULL``, it is decoded from the filesystem encoding (:func:`os.fsdecode`) and passed to the constructor of :exc:`OSError` as a third parameter to be used to define the :attr:`!filename` attribute of the exception instance."
msgstr "مشابه :c:func:`PyErr_SetFromWindowsErr`، با این رفتار افزوده که اگر *filename* برابر ``NULL`` نباشد، بر اساس کدگذاری سامانه فایلبندی (:func:`os.fsdecode`) کدگشایی میشود و بهعنوان پارامتر سوم به سازندهی :exc:`OSError` ارسال میشود تا برای تعریف ویژگی :attr:`!filename` در نمونهی استثنا استفاده شود."
msgid "Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional behavior that if *filename* is not ``NULL``, it is passed to the constructor of :exc:`OSError` as a third parameter to be used to define the :attr:`!filename` attribute of the exception instance."
msgstr "مشابه :c:func:`PyErr_SetExcFromWindowsErr`، با این رفتار اضافی که اگر *filename* برابر ``NULL`` نباشد، بهعنوان پارامتر سوم به سازندهی :exc:`OSError` پاس داده میشود تا برای تعریف ویژگی :attr:`!filename` در نمونهی استثنا استفاده شود."
msgid "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but accepts a second filename object."
msgstr "مشابه :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject` است، اما یک شیء نام پروندهی دوم را میپذیرد."
msgid "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional parameter specifying the exception type to be raised."
msgstr "مشابه :c:func:`PyErr_SetFromWindowsErrWithFilename`، با یک پارامتر اضافی برای مشخص کردن نوع استثنایی که باید مطرح (raise) شود."
msgid "This is a convenience function to raise :exc:`ImportError`. *msg* will be set as the exception's message string. *name* and *path*, both of which can be ``NULL``, will be set as the :exc:`ImportError`'s respective ``name`` and ``path`` attributes."
msgstr "این یک تابع کمکی برای ایجاد استثنای :exc:`ImportError` است. *msg* بهعنوان رشتهی پیام استثنا تنظیم میشود. *name* و *path*، که هر دو میتوانند ``NULL`` باشند، بهترتیب بهعنوان ویژگیهای ``name`` و ``path`` مربوط به :exc:`ImportError` تنظیم میشوند."
msgid "Much like :c:func:`PyErr_SetImportError` but this function allows for specifying a subclass of :exc:`ImportError` to raise."
msgstr "بسیار شبیه :c:func:`PyErr_SetImportError` است، اما این تابع به شما امکان میدهد زیرکلاسی از :exc:`ImportError` را برای برافکندن مشخص کنید."
msgid "Set file, line, and offset information for the current exception. If the current exception is not a :exc:`SyntaxError`, then it sets additional attributes, which make the exception printing subsystem think the exception is a :exc:`SyntaxError`."
msgstr "اطلاعات پرونده، سطر و آفست را برای استثنای کنونی تنظیم میکند. اگر استثنای کنونی :exc:`SyntaxError` نباشد، ویژگیهای اضافی تنظیم میکند که باعث میشوند زیرسیستم چاپ استثنا، استثنا را یک :exc:`SyntaxError` تلقی کند."
msgid "Similar to :c:func:`PyErr_SyntaxLocationObject`, but also sets the *end_lineno* and *end_col_offset* information for the current exception."
msgstr "مشابه :c:func:`PyErr_SyntaxLocationObject`، اما اطلاعات *end_lineno* و *end_col_offset* را نیز برای استثنای فعلی تنظیم میکند."
msgid "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string decoded from the :term:`filesystem encoding and error handler`."
msgstr "مانند :c:func:`PyErr_SyntaxLocationObject`، اما *filename* یک رشته بایتی است که با :term:`filesystem encoding and error handler` کدگشاییشده است."
msgid "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is omitted."
msgstr "مانند :c:func:`PyErr_SyntaxLocationEx`، اما پارامتر *col_offset* حذف شده است."
msgid "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, where *message* indicates that an internal operation (e.g. a Python/C API function) was invoked with an illegal argument. It is mostly for internal use."
msgstr "این یک شکل مختصر برای ``PyErr_SetString(PyExc_SystemError, message)`` است، که در آن *message* نشان میدهد که یک عملیات داخلی (مثلاً یک تابع Python/C API) با آرگومانی نامعتبر فراخوانی شده است. این عمدتاً برای استفاده داخلی است."
msgid "Get the source line in *filename* at line *lineno*. *filename* should be a Python :class:`str` object."
msgstr "گرفتن سطر منبع از *filename* در سطر *lineno*. *filename* باید یک شیء :class:`str` پایتون باشد."
msgid "On success, this function returns a Python string object with the found line. On failure, this function returns ``NULL`` without an exception set."
msgstr "در صورت موفقیت، این تابع یک شیء رشته پایتون حاوی سطر یافتشده را برمیگرداند. در صورت شکست، این تابع ``NULL`` را بدون تنظیم استثنا برمیگرداند."
msgid "Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a :c:expr:`const char *`, which is decoded with the :term:`filesystem encoding and error handler`, instead of a Python object reference."
msgstr "مشابه :c:func:`PyErr_ProgramTextObject`، اما *filename* بهجای ارجاع به شیء پایتون، یک :c:expr:`const char *` است که با :term:`filesystem encoding and error handler` کدگشایی میشود."
msgid "Issuing warnings"
msgstr "صدور هشدارها"
msgid "Use these functions to issue warnings from C code. They mirror similar functions exported by the Python :mod:`warnings` module. They normally print a warning message to *sys.stderr*; however, it is also possible that the user has specified that warnings are to be turned into errors, and in that case they will raise an exception. It is also possible that the functions raise an exception because of a problem with the warning machinery. The return value is ``0`` if no exception is raised, or ``-1`` if an exception is raised. (It is not possible to determine whether a warning message is actually printed, nor what the reason is for the exception; this is intentional.) If an exception is raised, the caller should do its normal exception handling (for example, :c:func:`Py_DECREF` owned references and return an error value)."
msgstr "از این توابع برای صدور هشدار از کد C استفاده کنید. این توابع قرینهی توابع مشابهی هستند که ماژول :mod:`warnings` پایتون اکسپورت میکند. این توابع معمولاً یک پیام هشدار را در *sys.stderr* چاپ میکنند؛ با این حال، این امکان نیز وجود دارد که کاربر تعیین کرده باشد که هشدارها به خطا تبدیل شوند، و در این حالت این توابع یک استثنا ایجاد میکنند. همچنین این امکان وجود دارد که توابع به دلیل مشکلی در سازوکار هشدار، استثنا ایجاد کنند. مقدار بازگشتی ``0`` است اگر استثنایی ایجاد نشود، یا ``-1`` اگر استثنایی ایجاد شود. (امکان تعیین اینکه آیا پیام هشدار واقعاً چاپ میشود یا اینکه دلیل استثنا چیست وجود ندارد؛ این موضوع عمدی است.) اگر استثنایی ایجاد شود، فراخواننده باید مدیریت استثنای معمول خود را انجام دهد (برای مثال، فراخوانی :c:func:`Py_DECREF` روی ارجاعهای در مالکیت و برگرداندن یک مقدار خطا)."
msgid "Issue a warning message. The *category* argument is a warning category (see below) or ``NULL``; the *message* argument is a UTF-8 encoded string. *stack_level* is a positive number giving a number of stack frames; the warning will be issued from the currently executing line of code in that stack frame. A *stack_level* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that, and so forth."
msgstr "یک پیام هشدار صادر میکند. آرگومان *category* یک دستهی هشدار است (در ادامه مراجعه کنید) یا ``NULL``؛ آرگومان *message* یک رشتهی کدگذاریشده با UTF-8 است. *stack_level* یک عدد مثبت است که تعداد فریمهای پشته را مشخص میکند؛ هشدار از سطر کدِ در حال اجرا در آن فریم پشته صادر خواهد شد. *stack_level* برابر ۱ تابعی است که :c:func:`PyErr_WarnEx` را فراخوانی میکند، ۲ تابع بالاتر از آن است، و به همین ترتیب."
msgid "Warning categories must be subclasses of :c:data:`PyExc_Warning`; :c:data:`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the default warning category is :c:data:`PyExc_RuntimeWarning`. The standard Python warning categories are available as global variables whose names are enumerated at :ref:`standardwarningcategories`."
msgstr "دستههای هشدار باید زیرکلاسهایی از :c:data:`PyExc_Warning` باشند؛ :c:data:`PyExc_Warning` زیرکلاسی از :c:data:`PyExc_Exception` است؛ دستهی پیشفرض هشدار، :c:data:`PyExc_RuntimeWarning` است. دستههای هشدار استاندارد پایتون بهصورت متغیرهای سراسری در دسترس هستند که نامهای آنها در :ref:`standardwarningcategories` فهرست شده است."
msgid "For information about warning control, see the documentation for the :mod:`warnings` module and the :option:`-W` option in the command line documentation. There is no C API for warning control."
msgstr "برای کسب اطلاعات دربارهی کنترل هشدارها، به مستندات ماژول :mod:`warnings` و گزینهی :option:`-W` در مستندات خط فرمان مراجعه کنید. برای کنترل هشدارها API زبان C وجود ندارد."
msgid "Issue a warning message with explicit control over all warning attributes. This is a straightforward wrapper around the Python function :func:`warnings.warn_explicit`; see there for more information. The *module* and *registry* arguments may be set to ``NULL`` to get the default effect described there."
msgstr "یک پیام هشدار با کنترل صریح بر تمام ویژگیهای هشدار صادر میکند. این پوششی ساده در اطراف تابع پایتونی :func:`warnings.warn_explicit` است؛ برای اطلاعات بیشتر به آنجا مراجعه کنید. آرگومانهای *module* و *registry* میتوانند روی ``NULL`` تنظیم شوند تا اثر پیشفرضِ توصیفشده در آنجا به دست آید."
msgid "Similar to :c:func:`PyErr_WarnExplicitObject` except that *message* and *module* are UTF-8 encoded strings, and *filename* is decoded from the :term:`filesystem encoding and error handler`."
msgstr "مشابه :c:func:`PyErr_WarnExplicitObject` است، با این تفاوت که *message* و *module* رشتههای کدگذاریشده با UTF-8 هستند و *filename* از :term:`filesystem encoding and error handler` کدگشایی میشود."
msgid "Function similar to :c:func:`PyErr_WarnEx`, but uses :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-encoded string."
msgstr "تابعی مشابه :c:func:`PyErr_WarnEx` است، اما از :c:func:`PyUnicode_FromFormat` برای قالببندی پیام هشدار استفاده میکند. *format* یک رشته کدگذاریشده با اسکی است."
msgid "Similar to :c:func:`PyErr_WarnExplicit`, but uses :c:func:`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-encoded string."
msgstr "مشابه :c:func:`PyErr_WarnExplicit`، اما برای قالببندی پیام هشدار از :c:func:`PyUnicode_FromFormat` استفاده میکند. *format* یک رشته کدگذاریشده با اسکی است."
msgid "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:`ResourceWarning` and it passes *source* to :class:`!warnings.WarningMessage`."
msgstr "تابعی مشابه :c:func:`PyErr_WarnFormat`، اما *category* برابر :exc:`ResourceWarning` است و *source* را به :class:`!warnings.WarningMessage` پاس میدهد."
msgid "Querying the error indicator"
msgstr "پرسوجو از نشانگر خطا"
msgid "Test whether the error indicator is set. If set, return the exception *type* (the first argument to the last call to one of the ``PyErr_Set*`` functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You do not own a reference to the return value, so you do not need to :c:func:`Py_DECREF` it."
msgstr "بررسی میکند که آیا نشانگر خطا تنظیم شده است. اگر تنظیم شده باشد، *نوع* استثنا را برمیگرداند (آرگومان اول آخرین فراخوانی یکی از توابع ``PyErr_Set*`` یا :c:func:`PyErr_Restore`). اگر تنظیم نشده باشد، ``NULL`` را برمیگرداند. شما مالک ارجاع به مقدار بازگشتی نیستید، بنابراین نیازی به :c:func:`Py_DECREF` کردن آن ندارید."
msgid "The caller must have an :term:`attached thread state`."
msgstr "فراخواننده باید :term:`attached thread state` داشته باشد."
msgid "Do not compare the return value to a specific exception; use :c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily fail since the exception may be an instance instead of a class, in the case of a class exception, or it may be a subclass of the expected exception.)"
msgstr "مقدار بازگشتی را با یک استثنای مشخص مقایسه نکنید؛ در عوض از :c:func:`PyErr_ExceptionMatches` استفاده کنید که در ادامه نشان داده شده است. (این مقایسه بهراحتی میتواند شکست بخورد، زیرا در مورد استثنای کلاسی، استثنا ممکن است به جای کلاس، نمونهای باشد، یا ممکن است زیرکلاسی از استثنای مورد انتظار باشد.)"
msgid "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This should only be called when an exception is actually set; a memory access violation will occur if no exception has been raised."
msgstr "معادل ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)`` است. این باید تنها زمانی فراخوانی شود که استثنا واقعاً تنظیم شده باشد؛ اگر هیچ استثنایی ایجاد نشده باشد، نقض دسترسی به حافظه (memory access violation) رخ خواهد داد."
msgid "Return true if the *given* exception matches the exception type in *exc*. If *exc* is a class object, this also returns true when *given* is an instance of a subclass. If *exc* is a tuple, all exception types in the tuple (and recursively in subtuples) are searched for a match."
msgstr "اگر استثنای *given* با نوع استثنا در *exc* مطابقت داشته باشد، مقدار true بازگردانده میشود. اگر *exc* یک شیء کلاس باشد، در صورتی که *given* نمونهای از یک زیرکلاس باشد نیز مقدار true بازگردانده میشود. اگر *exc* یک تاپل باشد، تمام انواع استثنا در تاپل (و بهصورت بازگشتی در زیرتاپلها) برای یافتن تطبیق جستجو میشوند."
msgid "Return the exception currently being raised, clearing the error indicator at the same time. Return ``NULL`` if the error indicator is not set."
msgstr "استثنایی که هماکنون در حال raise شدن است را برمیگرداند و همزمان نشانگر خطا را پاک میکند. اگر نشانگر خطا تنظیم نشده باشد، ``NULL`` را برمیگرداند."
msgid "This function is used by code that needs to catch exceptions, or code that needs to save and restore the error indicator temporarily."
msgstr "این تابع توسط کدهایی استفاده میشود که نیاز به گرفتن استثناها دارند، یا کدهایی که نیاز دارند نشانگر خطا را بهطور موقت ذخیره و بازیابی کنند."
msgid "For example::"
msgstr "برای مثال::"
msgid ""
"{\n"
" PyObject *exc = PyErr_GetRaisedException();\n"
"\n"
" /* ... code that might produce other errors ... */\n"
"\n"
" PyErr_SetRaisedException(exc);\n"
"}"
msgstr ""
"{\n"
" PyObject *exc = PyErr_GetRaisedException();\n"
"\n"
" /* ... code that might produce other errors ... */\n"
"\n"
" PyErr_SetRaisedException(exc);\n"
"}"
msgid ":c:func:`PyErr_GetHandledException`, to save the exception currently being handled."
msgstr ":c:func:`PyErr_GetHandledException`، برای ذخیرهی استثنایی که در حال حاضر مدیریت میشود."
msgid "Set *exc* as the exception currently being raised, clearing the existing exception if one is set. If *exc* is ``NULL``, just clear the existing exception."
msgstr "*exc* را به عنوان استثنای در حال رخ دادن تنظیم میکند و اگر استثنایی از قبل تنظیم شده باشد، آن را پاک میکند. اگر *exc* برابر ``NULL`` باشد، تنها استثنای موجود پاک میشود."
msgid "*exc* must be a valid exception or ``NULL``."
msgstr "*exc* باید یک استثنای معتبر یا ``NULL`` باشد."
msgid "This call \":term:`steals <steal>`\" a reference to *exc*."
msgstr "این فراخوانی ارجاعی به *exc* را «:term:`میدزدد <steal>`»."
msgid "Use :c:func:`PyErr_GetRaisedException` instead."
msgstr "به جای آن از :c:func:`PyErr_GetRaisedException` استفاده کنید."
msgid "Retrieve the error indicator into three variables whose addresses are passed. If the error indicator is not set, set all three variables to ``NULL``. If it is set, it will be cleared and you own a reference to each object retrieved. The value and traceback object may be ``NULL`` even when the type object is not."
msgstr "نشانگر خطا را در سه متغیر که آدرس آنها ارسال شده است، بازیابی کنید. اگر نشانگر خطا فعال نباشد، هر سه متغیر را روی ``NULL`` تنظیم کنید. اگر فعال باشد، پاک میشود و شما مالک یک ارجاع به هر یک از اشیای بازیابیشده خواهید بود. شیء مقدار و شیء ردیابی پشته ممکن است حتی زمانی که شیء نوع NULL نیست، ``NULL`` باشند."
msgid "This function is normally only used by legacy code that needs to catch exceptions or save and restore the error indicator temporarily."
msgstr "این تابع معمولاً تنها توسط کدهای قدیمیای استفاده میشود که نیاز دارند استثناها را بگیرند یا نشانگر خطا را بهطور موقت ذخیره و بازیابی کنند."
msgid ""
"{\n"
" PyObject *type, *value, *traceback;\n"
" PyErr_Fetch(&type, &value, &traceback);\n"
"\n"
" /* ... code that might produce other errors ... */\n"
"\n"
" PyErr_Restore(type, value, traceback);\n"
"}"
msgstr ""
"{\n"
" PyObject *type, *value, *traceback;\n"
" PyErr_Fetch(&type, &value, &traceback);\n"
"\n"
" /* ... code that might produce other errors ... */\n"
"\n"
" PyErr_Restore(type, value, traceback);\n"
"}"
msgid "Use :c:func:`PyErr_SetRaisedException` instead."
msgstr "بهجای آن از :c:func:`PyErr_SetRaisedException` استفاده کنید."
msgid "Set the error indicator from the three objects, *type*, *value*, and *traceback*, clearing the existing exception if one is set. If the objects are ``NULL``, the error indicator is cleared. Do not pass a ``NULL`` type and non-``NULL`` value or traceback. The exception type should be a class. Do not pass an invalid exception type or value. (Violating these rules will cause subtle problems later.) This call takes away a reference to each object: you must own a reference to each object before the call and after the call you no longer own these references. (If you don't understand this, don't use this function. I warned you.)"
msgstr "نشانگر خطا را از سه شیء *type*، *value* و *traceback* تنظیم میکند و اگر استثنایی از پیش تنظیم شده باشد، استثنای موجود را پاک میکند. اگر این اشیاء ``NULL`` باشند، نشانگر خطا پاک میشود. نوع ``NULL`` را همراه با مقدار یا ردگیری غیر ``NULL`` ارسال نکنید. نوع استثنا باید یک کلاس باشد. نوع یا مقدار نامعتبر برای استثنا ارسال نکنید. (نقض این قواعد بعداً موجب مشکلات ظریفی خواهد شد.) این فراخوانی یک ارجاع به هر شیء را برمیدارد: شما باید پیش از فراخوانی مالک ارجاعی به هر شیء باشید و پس از فراخوانی، دیگر مالک این ارجاعها نخواهید بود. (اگر این را نمیفهمید، از این تابع استفاده نکنید. من به شما هشدار دادم.)"
msgid "This function is normally only used by legacy code that needs to save and restore the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save the current error indicator."
msgstr "این تابع معمولاً فقط توسط کدهای قدیمیای استفاده میشود که نیاز دارند نشانگر خطا را بهطور موقت ذخیره و بازیابی کنند. برای ذخیره کردن نشانگر خطای فعلی، از :c:func:`PyErr_Fetch` استفاده کنید."
msgid "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-normalization."
msgstr "به جای آن از :c:func:`PyErr_GetRaisedException` استفاده کنید تا از هرگونه نرمالزدایی (de-normalization) احتمالی جلوگیری شود."
msgid "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` below can be \"unnormalized\", meaning that ``*exc`` is a class object but ``*val`` is not an instance of the same class. This function can be used to instantiate the class in that case. If the values are already normalized, nothing happens. The delayed normalization is implemented to improve performance."
msgstr "در شرایط خاص، مقادیری که :c:func:`PyErr_Fetch` در ادامه بازمیگرداند میتوانند «نرمالنشده» باشند؛ یعنی ``*exc`` یک شیء کلاس است اما ``*val`` نمونهای از همان کلاس نیست. در این حالت میتوان از این تابع برای نمونهسازی کردن کلاس استفاده کرد. اگر مقادیر از قبل نرمال شده باشند، هیچ اتفاقی نمیافتد. نرمالسازی معوق برای بهبود کارایی پیادهسازی شده است."
msgid "This function *does not* implicitly set the :attr:`~BaseException.__traceback__` attribute on the exception value. If setting the traceback appropriately is desired, the following additional snippet is needed::"
msgstr "این تابع ویژگی :attr:`~BaseException.__traceback__` را بهصورت ضمنی روی مقدار استثنا *تنظیم نمیکند*. اگر مایلید ردگیری بهنحو مناسب تنظیم شود، قطعهکد اضافی زیر لازم است::"
msgid ""
"if (tb != NULL) {\n"
" PyException_SetTraceback(val, tb);\n"
"}"
msgstr ""
"if (tb != NULL) {\n"
" PyException_SetTraceback(val, tb);\n"
"}"
msgid "Retrieve the active exception instance, as would be returned by :func:`sys.exception`. This refers to an exception that was *already caught*, not to an exception that was freshly raised. Returns a new reference to the exception or ``NULL``. Does not modify the interpreter's exception state."
msgstr "نمونهی استثنای فعال را بازیابی میکند؛ همان چیزی که :func:`sys.exception` برمیگرداند. این به استثنایی اشاره دارد که *از قبل گرفتهشده* است، نه به استثنایی که بهتازگی ایجاد (raise) شده است. یک ارجاع جدید به استثنا یا ``NULL`` برمیگرداند. وضعیت استثنای مفسر را تغییر نمیدهد."
msgid "This function is not normally used by code that wants to handle exceptions. Rather, it can be used when code needs to save and restore the exception state temporarily. Use :c:func:`PyErr_SetHandledException` to restore or clear the exception state."
msgstr "این تابع بهطور معمول توسط کدهایی که میخواهند استثناها را مدیریت کنند استفاده نمیشود؛ بلکه میتوان از آن در مواردی استفاده کرد که کد نیاز دارد وضعیت استثنا را بهطور موقت ذخیره و بازیابی کند. برای بازیابی یا پاک کردن وضعیت استثنا از :c:func:`PyErr_SetHandledException` استفاده کنید."
msgid "Set the active exception, as known from ``sys.exception()``. This refers to an exception that was *already caught*, not to an exception that was freshly raised. To clear the exception state, pass ``NULL``."
msgstr "استثنای فعال را، همانطور که از ``sys.exception()`` شناخته میشود، تنظیم کنید. این به استثنایی اشاره دارد که *از قبل گرفتهشده* است، نه به استثنایی که بهتازگی ایجاد (raised) شده است. برای پاک کردن وضعیت استثنا، ``NULL`` را ارسال کنید."
msgid "This function is not normally used by code that wants to handle exceptions. Rather, it can be used when code needs to save and restore the exception state temporarily. Use :c:func:`PyErr_GetHandledException` to get the exception state."
msgstr "این تابع معمولاً توسط کدی که میخواهد استثناها را مدیریت کند استفاده نمیشود؛ بلکه زمانی به کار میرود که کد نیاز داشته باشد وضعیت استثنا را بهطور موقت ذخیره و بازیابی کند. برای دریافت وضعیت استثنا از :c:func:`PyErr_GetHandledException` استفاده کنید."
msgid "Retrieve the old-style representation of the exception info, as known from :func:`sys.exc_info`. This refers to an exception that was *already caught*, not to an exception that was freshly raised. Returns new references for the three objects, any of which may be ``NULL``. Does not modify the exception info state. This function is kept for backwards compatibility. Prefer using :c:func:`PyErr_GetHandledException`."
msgstr "بازنمایی قدیمی اطلاعات استثنا را، همانگونه که از :func:`sys.exc_info` شناخته میشود، بازیابی میکند. این به استثنایی اشاره دارد که *از پیش گرفته شده* است، نه به استثنایی که بهتازگی مطرح (raise) شده است. ارجاعهای جدیدی برای سه شیء برمیگرداند که هر یک ممکن است ``NULL`` باشد. وضعیت اطلاعات استثنا را تغییر نمیدهد. این تابع برای سازگاری با نسخههای پیشین نگه داشته شده است. ترجیحاً از :c:func:`PyErr_GetHandledException` استفاده کنید."
msgid "This function is not normally used by code that wants to handle exceptions. Rather, it can be used when code needs to save and restore the exception state temporarily. Use :c:func:`PyErr_SetExcInfo` to restore or clear the exception state."
msgstr "این تابع معمولاً توسط کدهایی که میخواهند استثناها را مدیریت کنند استفاده نمیشود. بلکه میتوان از آن در مواردی استفاده کرد که کد نیاز دارد وضعیت استثنا را بهطور موقت ذخیره و بازیابی کند. برای بازیابی یا پاک کردن وضعیت استثنا از :c:func:`PyErr_SetExcInfo` استفاده کنید."
msgid "Set the exception info, as known from ``sys.exc_info()``. This refers to an exception that was *already caught*, not to an exception that was freshly raised. This function \":term:`steals <steal>`\" the references of the arguments. To clear the exception state, pass ``NULL`` for all three arguments. This function is kept for backwards compatibility. Prefer using :c:func:`PyErr_SetHandledException`."
msgstr "اطلاعات استثنا را همانطور که از ``sys.exc_info()`` شناخته میشود تنظیم میکند. این به استثنایی اشاره دارد که *قبلاً گرفتهشده* است، نه به استثنایی که بهتازگی ایجاد (raise) شده است. این تابع ارجاعهای آرگومانها را «:term:`میدزدد <steal>`». برای پاک کردن وضعیت استثنا، ``NULL`` را برای هر سه آرگومان ارسال کنید. این تابع برای سازگاری با نسخههای پیشین نگه داشته شده است. ترجیحاً از :c:func:`PyErr_SetHandledException` استفاده کنید."
msgid "This function is not normally used by code that wants to handle exceptions. Rather, it can be used when code needs to save and restore the exception state temporarily. Use :c:func:`PyErr_GetExcInfo` to read the exception state."
msgstr "این تابع بهطور معمول توسط کدی که میخواهد استثناها را مدیریت کند، استفاده نمیشود. بلکه، زمانی که کد نیاز دارد وضعیت استثنا را بهطور موقت ذخیره و بازیابی کند، میتوان از آن استفاده کرد. برای خواندن وضعیت استثنا از :c:func:`PyErr_GetExcInfo` استفاده کنید."
msgid "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. The interpreter now derives them from the exception instance (the ``value`` argument). The function still \":term:`steals <steal>`\" references of all three arguments."
msgstr "آرگومانهای ``type`` و ``traceback`` دیگر استفاده نمیشوند و میتوانند NULL باشند. مفسر اکنون آنها را از نمونهی استثنا (آرگومان ``value``) استخراج میکند. این تابع همچنان ارجاعهای هر سه آرگومان را «:term:`میدزدد <steal>`»."
msgid "Signal Handling"
msgstr "مدیریت سیگنال"
msgid "Handle external interruptions, such as signals or activating a debugger, whose processing has been delayed until it is safe to run Python code and/or raise exceptions."
msgstr "رسیدگی میکند به وقفههای خارجی، مانند سیگنالها یا فعالسازی اشکالزدا، که پردازش آنها به تعویق افتاده است تا زمانی که اجرای کد پایتون و/یا برافراختن استثناها ایمن باشد."
msgid "For example, pressing :kbd:`Ctrl-C` causes a terminal to send the :py:data:`signal.SIGINT` signal. This function executes the corresponding Python signal handler, which, by default, raises the :exc:`KeyboardInterrupt` exception."
msgstr "برای مثال، فشردن :kbd:`Ctrl-C` باعث میشود یک پایانه سیگنال :py:data:`signal.SIGINT` را ارسال کند. این تابع هندلر سیگنال متناظر در پایتون را اجرا میکند که بهطور پیشفرض استثنای :exc:`KeyboardInterrupt` را ایجاد میکند."
msgid ":c:func:`!PyErr_CheckSignals` should be called by long-running C code frequently enough so that the response appears immediate to humans."
msgstr ":c:func:`!PyErr_CheckSignals` باید توسط کد C طولانیمدت بهاندازهای مکرر فراخوانی شود که پاسخ از دید انسانها فوری بهنظر برسد."
msgid "Handlers invoked by this function currently include:"
msgstr "هندلرهایی که توسط این تابع فراخوانی میشوند، در حال حاضر عبارتاند از:"
msgid "Signal handlers, including Python functions registered using the :mod:`signal` module."
msgstr "هندلرهای سیگنال، از جمله توابع پایتونی که با استفاده از ماژول :mod:`signal` ثبت شدهاند."
msgid "Signal handlers are only run in the main thread of the main interpreter."
msgstr "هندلرهای سیگنال فقط در نخ اصلی مفسر اصلی اجرا میشوند."
msgid "(This is where the function got the name: originally, signals were the only way to interrupt the interpreter.)"
msgstr "(این تابع نام خود را از اینجا گرفته است: در اصل، سیگنالها تنها راه برای مقاطعه کردن مفسر بودند.)"
msgid "Running the garbage collector, if necessary."
msgstr "اجرای زبالهروب، در صورت نیاز."
msgid "Executing a pending :ref:`remote debugger <remote-debugging>` script."
msgstr "اجرای یک اسکریپت در انتظار :ref:`اشکالزدای راه دور <remote-debugging>`."
msgid "If any handler raises an exception, immediately return ``-1`` with that exception set. Any remaining interruptions are left to be processed on the next :c:func:`PyErr_CheckSignals()` invocation, if appropriate."
msgstr "اگر هر هندلری استثنایی ایجاد کند، بلافاصله ``-1`` همراه با آن استثنای تنظیمشده بازگردانده میشود. پردازش هر وقفهی باقیمانده، در صورت لزوم، به فراخوانی بعدی :c:func:`PyErr_CheckSignals()` موکول میشود."
msgid "If all handlers finish successfully, or there are no handlers to run, return ``0``."
msgstr "اگر همهی هندلرها با موفقیت پایان یابند، یا هندلری برای اجرا وجود نداشته باشد، ``0`` را برمیگرداند."
msgid "This function may now invoke the garbage collector."
msgstr "این تابع ممکن است اکنون زبالهروب را فراخوانی کند."
msgid "This function may now execute a remote debugger script, if remote debugging is enabled."
msgstr "این تابع اکنون ممکن است در صورت فعال بودن اشکالزدایی از راه دور، یک اسکریپت اشکالزدای از راه دور را اجرا کند."
msgid "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is equivalent to ``PyErr_SetInterruptEx(SIGINT)``."
msgstr "اثر رسیدن سیگنال :c:macro:`!SIGINT` را شبیهسازی میکند. این معادل ``PyErr_SetInterruptEx(SIGINT)`` است."
msgid "This function is async-signal-safe. It can be called without an :term:`attached thread state` and from a C signal handler."
msgstr "این تابع نسبت به سیگنال ناهمگام ایمن است (async-signal-safe). این تابع را میتوان بدون :term:`وضعیت نخ متصل <attached thread state>` و از یک هندلر سیگنال C فراخوانی کرد."
msgid "Simulate the effect of a signal arriving. The next time :c:func:`PyErr_CheckSignals` is called, the Python signal handler for the given signal number will be called."
msgstr "شبیهسازی اثر رسیدن یک سیگنال. دفعه بعد که :c:func:`PyErr_CheckSignals` فراخوانی شود، هندلر سیگنال پایتون برای شماره سیگنال دادهشده فراخوانی خواهد شد."
msgid "This function can be called by C code that sets up its own signal handling and wants Python signal handlers to be invoked as expected when an interruption is requested (for example when the user presses Ctrl-C to interrupt an operation)."
msgstr "این تابع را میتوان از کد Cای فراخوانی کرد که مدیریت سیگنال خود را راهاندازی میکند و میخواهد هندلرهای سیگنال پایتون هنگامی که وقفهای درخواست شود، همانطور که انتظار میرود فراخوانی شوند (برای مثال وقتی کاربر برای قطع کردن یک عملیات، Ctrl-C را فشار میدهد)."
msgid "If the given signal isn't handled by Python (it was set to :py:const:`signal.SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored."
msgstr "اگر سیگنال دادهشده توسط پایتون هندل نشده باشد (روی :py:const:`signal.SIG_DFL` یا :py:const:`signal.SIG_IGN` تنظیمشده باشد)، نادیده گرفته خواهد شد."
msgid "If *signum* is outside of the allowed range of signal numbers, ``-1`` is returned. Otherwise, ``0`` is returned. The error indicator is never changed by this function."
msgstr "اگر *signum* خارج از بازهی مجاز شمارههای سیگنال باشد، مقدار ``-1`` بازگردانده میشود. در غیر این صورت، مقدار ``0`` بازگردانده میشود. این تابع هرگز نشانگر خطا را تغییر نمیدهد."
msgid "This utility function specifies a file descriptor to which the signal number is written as a single byte whenever a signal is received. *fd* must be non-blocking. It returns the previous such file descriptor."
msgstr "این تابع کاربردی، توصیفگر پروندهای را مشخص میکند که هر زمان سیگنالی دریافت شود، شمارهی سیگنال بهصورت یک بایت منفرد در آن نوشته میشود. *fd* باید غیرمسدود باشد. این تابع توصیفگر پروندهی قبلی از این نوع را برمیگرداند."
msgid "The value ``-1`` disables the feature; this is the initial state. This is equivalent to :func:`signal.set_wakeup_fd` in Python, but without any error checking. *fd* should be a valid file descriptor. The function should only be called from the main thread."
msgstr "مقدار ``-1`` این قابلیت را غیرفعال میکند؛ این وضعیت اولیه است. این معادل :func:`signal.set_wakeup_fd` در پایتون است، اما بدون هیچ بررسی خطایی. *fd* باید یک توصیفگر پرونده معتبر باشد. این تابع باید فقط از نخ اصلی فراخوانی شود."
msgid "On Windows, the function now also supports socket handles."
msgstr "در ویندوز، این تابع اکنون از دستههای سوکت نیز پشتیبانی میکند."
msgid "Exception Classes"
msgstr "کلاسهای استثنا"
msgid "This utility function creates and returns a new exception class. The *name* argument must be the name of the new exception, a C string of the form ``module.classname``. The *base* and *dict* arguments are normally ``NULL``. This creates a class object derived from :exc:`Exception` (accessible in C as :c:data:`PyExc_Exception`)."
msgstr "این تابع کاربردی یک کلاس استثنای جدید ایجاد میکند و آن را برمیگرداند. آرگومان *name* باید نام استثنای جدید باشد؛ یعنی یک رشتهی C به شکل ``module.classname``. آرگومانهای *base* و *dict* معمولاً ``NULL`` هستند. این یک شیء کلاس مشتقشده از :exc:`Exception` ایجاد میکند (که در C به صورت :c:data:`PyExc_Exception` قابل دسترسی است)."
msgid "The :attr:`~type.__module__` attribute of the new class is set to the first part (up to the last dot) of the *name* argument, and the class name is set to the last part (after the last dot). The *base* argument can be used to specify alternate base classes; it can either be only one class or a tuple of classes. The *dict* argument can be used to specify a dictionary of class variables and methods."
msgstr "ویژگی :attr:`~type.__module__` کلاس جدید به بخش اول (تا آخرین نقطه) آرگومان *name* تنظیم میشود و نام کلاس به بخش آخر (پس از آخرین نقطه) تنظیم میشود. از آرگومان *base* میتوان برای مشخص کردن کلاسهای پایهی جایگزین استفاده کرد؛ این آرگومان میتواند تنها یک کلاس یا یک تاپل از کلاسها باشد. از آرگومان *dict* میتوان برای مشخص کردن یک دیکشنری از متغیرهای کلاس و متدها استفاده کرد."
msgid "Same as :c:func:`PyErr_NewException`, except that the new exception class can easily be given a docstring: If *doc* is non-``NULL``, it will be used as the docstring for the exception class."
msgstr "مانند :c:func:`PyErr_NewException` است، با این تفاوت که میتوان بهراحتی به کلاس استثنای جدید یک رشته مستند داد: اگر *doc* مقدار ``NULL`` نباشد، از آن بهعنوان رشته مستند کلاس استثنا استفاده خواهد شد."
msgid "Return non-zero if *ob* is an exception class, zero otherwise. This function always succeeds."
msgstr "اگر *ob* یک کلاس استثنا باشد، مقدار ناصفر و در غیر این صورت صفر برمیگرداند. این تابع همیشه با موفقیت اجرا میشود."
msgid "Return :c:member:`~PyTypeObject.tp_name` of the exception class *ob*."
msgstr ":c:member:`~PyTypeObject.tp_name` کلاس استثنا *ob* را بازمیگرداند."
msgid "Exception Objects"
msgstr "اشیاء استثنا"
msgid "Return true if *op* is an instance of :class:`BaseException`, false otherwise. This function always succeeds."
msgstr "اگر *op* نمونهای از :class:`BaseException` باشد، true برمیگرداند و در غیر این صورت false. این تابع همیشه با موفقیت انجام میشود."
msgid "Equivalent to :c:func:`Py_TYPE(op) <Py_TYPE>`."
msgstr "معادل :c:func:`Py_TYPE(op) <Py_TYPE>` است."
msgid "Return the traceback associated with the exception as a new reference, as accessible from Python through the :attr:`~BaseException.__traceback__` attribute. If there is no traceback associated, this returns ``NULL``."
msgstr "ردگیری مرتبط با استثنا را بهعنوان یک ارجاع جدید برمیگرداند؛ همانطور که از پایتون از طریق ویژگی :attr:`~BaseException.__traceback__` قابل دسترسی است. اگر هیچ ردگیری مرتبطی وجود نداشته باشد، این تابع ``NULL`` را برمیگرداند."
msgid "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to clear it."
msgstr "ردگیری مرتبط با استثنا را برابر *tb* قرار میدهد. برای پاک کردن آن از ``Py_None`` استفاده کنید."
msgid "Return the context (another exception instance during whose handling *ex* was raised) associated with the exception as a new reference, as accessible from Python through the :attr:`~BaseException.__context__` attribute. If there is no context associated, this returns ``NULL``."
msgstr "زمینه (نمونه استثنای دیگری که در حین مدیریت آن، *ex* پرتاب شده است) مرتبط با استثنا را بهعنوان یک ارجاع جدید برمیگرداند؛ همانطور که از پایتون از طریق ویژگی :attr:`~BaseException.__context__` دسترسیپذیر است. اگر زمینهای مرتبط نباشد، این تابع ``NULL`` را برمیگرداند."
msgid "Set the context associated with the exception to *ctx*. Use ``NULL`` to clear it. There is no type check to make sure that *ctx* is an exception instance. This \":term:`steals <steal>`\" a reference to *ctx*."
msgstr "زمینه مرتبط با استثنا را به *ctx* تنظیم میکند. برای پاککردن آن از ``NULL`` استفاده کنید. هیچ بررسی نوعی برای اطمینان از اینکه *ctx* نمونهای از استثنا است انجام نمیشود. این تابع ارجاعی به *ctx* را «:term:`میدزدد <steal>`»."
msgid "Return the cause (either an exception instance, or ``None``, set by ``raise ... from ...``) associated with the exception as a new reference, as accessible from Python through the :attr:`~BaseException.__cause__` attribute."
msgstr "بازگرداندن علت مرتبط با استثنا (که یا یک نمونهی استثنا است یا ``None``، و توسط ``raise ... from ...`` تنظیم شده است) بهعنوان یک ارجاع جدید، همانطور که در پایتون از طریق ویژگی :attr:`~BaseException.__cause__` قابل دسترسی است."
msgid "Set the cause associated with the exception to *cause*. Use ``NULL`` to clear it. There is no type check to make sure that *cause* is either an exception instance or ``None``. This \":term:`steals <steal>`\" a reference to *cause*."
msgstr "علت مرتبط با استثنا را برابر *cause* قرار میدهد. برای پاک کردن آن از ``NULL`` استفاده کنید. هیچ بررسی نوعی برای اطمینان از اینکه *cause* یا نمونهای از استثنا است یا ``None``، انجام نمیشود. این یک ارجاع به *cause* را «:term:`میدزدد <steal>`»."
msgid "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set to ``True`` by this function."
msgstr "ویژگی :attr:`~BaseException.__suppress_context__` بهطور ضمنی توسط این تابع برابر ``True`` قرار میگیرد."
msgid "Return :attr:`~BaseException.args` of exception *ex*."
msgstr "بازگشت :attr:`~BaseException.args` از استثنای *ex*."
msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*."
msgstr "مقدار :attr:`~BaseException.args` استثنای *ex* را برابر *args* قرار میدهد."
msgid "Implement part of the interpreter's implementation of :keyword:`!except*`. *orig* is the original exception that was caught, and *excs* is the list of the exceptions that need to be raised. This list contains the unhandled part of *orig*, if any, as well as the exceptions that were raised from the :keyword:`!except*` clauses (so they have a different traceback from *orig*) and those that were reraised (and have the same traceback as *orig*). Return the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` if there is nothing to reraise."
msgstr "بخشی از پیادهسازی :keyword:`!except*` توسط مفسر را انجام میدهد. *orig* استثنای اصلی است که گرفته شده است، و *excs* فهرست استثناهایی است که باید مطرح (raise) شوند. این فهرست شامل بخش مدیریتنشدهی *orig* (در صورت وجود) و همچنین استثناهایی است که از بندهای :keyword:`!except*` مطرح شدهاند (بنابراین ردگیریشان با *orig* متفاوت است) و آنهایی که دوباره مطرح شدهاند (و ردگیریشان با *orig* یکسان است). :exc:`ExceptionGroup` را برمیگرداند که در نهایت باید دوباره مطرح شود، یا ``None`` را اگر چیزی برای مطرح شدن مجدد وجود ندارد."
msgid "Unicode Exception Objects"
msgstr "اشیاء استثنای یونیکد"
msgid "The following functions are used to create and modify Unicode exceptions from C."
msgstr "توابع زیر برای ایجاد و تغییر استثناهای یونیکد از C استفاده میشوند."
msgid "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are UTF-8 encoded strings."
msgstr "یک شیء :class:`UnicodeDecodeError` با ویژگیهای *encoding*، *object*، *length*، *start*، *end* و *reason* ایجاد کنید. *encoding* و *reason* رشتههای کدگذاریشده با UTF-8 هستند."
msgid "Return the *encoding* attribute of the given exception object."
msgstr "ویژگی *encoding* شیء استثنای دادهشده را بازمیگرداند."
msgid "Return the *object* attribute of the given exception object."
msgstr "ویژگی *object* شیء استثنای دادهشده را برمیگرداند."
msgid "Get the *start* attribute of the given exception object and place it into *\\*start*. *start* must not be ``NULL``. Return ``0`` on success, ``-1`` on failure."
msgstr "ویژگی *start* شیء استثنای دادهشده را میگیرد و آن را در *\\*start* قرار میدهد. *start* نباید ``NULL`` باشد. در صورت موفقیت ``0`` و در صورت شکست ``-1`` برمیگرداند."
msgid "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``."
msgstr "اگر :attr:`UnicodeError.object` یک دنبالهی خالی باشد، *start* حاصل ``0`` است. در غیر این صورت، *start* به ``[0, len(object) - 1]`` محدود میشود."
msgid ":attr:`UnicodeError.start`"
msgstr ":attr:`UnicodeError.start`"
msgid "Set the *start* attribute of the given exception object to *start*. Return ``0`` on success, ``-1`` on failure."
msgstr "ویژگی *start* شیء استثنای دادهشده را برابر *start* قرار میدهد. در صورت موفقیت ``0`` و در صورت شکست ``-1`` برمیگرداند."
msgid "While passing a negative *start* does not raise an exception, the corresponding getters will not consider it as a relative offset."
msgstr "اگرچه گذراندن یک *start* منفی استثنایی مطرح نمیکند، getterها (getters) مربوطه آن را بهعنوان یک آفست نسبی در نظر نخواهند گرفت."
msgid "Get the *end* attribute of the given exception object and place it into *\\*end*. *end* must not be ``NULL``. Return ``0`` on success, ``-1`` on failure."
msgstr "ویژگی *end* شیء استثنای دادهشده را دریافت میکند و آن را در *\\*end* قرار میدهد. *end* نباید ``NULL`` باشد. در صورت موفقیت ``0`` و در صورت شکست ``-1`` برمیگرداند."
msgid "If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end* is ``0``. Otherwise, it is clipped to ``[1, len(object)]``."
msgstr "اگر :attr:`UnicodeError.object` یک دنبالهی خالی باشد، *end* حاصل ``0`` است. در غیر این صورت، این مقدار به ``[1, len(object)]`` محدود میشود."
msgid "Set the *end* attribute of the given exception object to *end*. Return ``0`` on success, ``-1`` on failure."
msgstr "ویژگی *end* شیء استثنای دادهشده را به *end* تنظیم میکند. در صورت موفقیت ``0`` و در صورت شکست ``-1`` برمیگرداند."
msgid ":attr:`UnicodeError.end`"
msgstr ":attr:`UnicodeError.end`"
msgid "Return the *reason* attribute of the given exception object."
msgstr "ویژگی *reason* شیء استثنای دادهشده را برمیگرداند."
msgid "Set the *reason* attribute of the given exception object to *reason*. Return ``0`` on success, ``-1`` on failure."
msgstr "ویژگی *reason* شیء استثنای دادهشده را برابر *reason* قرار میدهد. در صورت موفقیت ``0`` و در صورت شکست ``-1`` برمیگرداند."
msgid "Recursion Control"
msgstr "کنترل بازگشتی"
msgid "These two functions provide a way to perform safe recursive calls at the C level, both in the core and in extension modules. They are needed if the recursive code does not necessarily invoke Python code (which tracks its recursion depth automatically). They are also not needed for *tp_call* implementations because the :ref:`call protocol <call>` takes care of recursion handling."
msgstr "این دو تابع راهی برای انجام فراخوانیهای بازگشتی ایمن در سطح C فراهم میکنند، هم در هسته و هم در ماژولهای توسعهای. این توابع زمانی لازم هستند که کد بازگشتی لزوماً کد پایتون را فراخوانی نکند (که عمق بازگشت خود را بهطور خودکار پیگیری میکند). این توابع برای پیادهسازیهای *tp_call* نیز لازم نیستند، زیرا :ref:`پروتکل فراخوانی <call>` مدیریت بازگشت را بر عهده میگیرد."
msgid "Marks a point where a recursive C-level call is about to be performed."
msgstr "نقطهای را نشانگذاری میکند که در آن یک فراخوانی بازگشتی در سطح C در شرف انجام است."
msgid "The function then checks if the stack limit is reached. If this is the case, a :exc:`RecursionError` is set and a nonzero value is returned. Otherwise, zero is returned."
msgstr "سپس تابع بررسی میکند که آیا به حد پشته رسیده است یا خیر. اگر چنین باشد، یک :exc:`RecursionError` تنظیم میشود و مقدار غیرصفر بازگردانده میشود. در غیر این صورت، صفر بازگردانده میشود."
msgid "*where* should be a UTF-8 encoded string such as ``\" in instance check\"`` to be concatenated to the :exc:`RecursionError` message caused by the recursion depth limit."
msgstr "*where* باید یک رشتهی کدگذاریشده با UTF-8 مانند ``\" in instance check\"`` باشد تا به پیام :exc:`RecursionError` که ناشی از محدودیت عمق بازگشت است، الحاق شود."
msgid "The :c:func:`PyUnstable_ThreadState_SetStackProtection` function."
msgstr "تابع :c:func:`PyUnstable_ThreadState_SetStackProtection`."
msgid "This function is now also available in the :ref:`limited API <limited-c-api>`."
msgstr "این تابع اکنون در :ref:`API محدود <limited-c-api>` نیز در دسترس است."
msgid "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each *successful* invocation of :c:func:`Py_EnterRecursiveCall`."
msgstr "یک :c:func:`Py_EnterRecursiveCall` را پایان میدهد. باید یکبار برای هر فراخوانی *موفق* :c:func:`Py_EnterRecursiveCall` فراخوانی شود."
msgid "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types requires special recursion handling. In addition to protecting the stack, :c:member:`~PyTypeObject.tp_repr` also needs to track objects to prevent cycles. The following two functions facilitate this functionality. Effectively, these are the C equivalent to :deco:`reprlib.recursive_repr`."
msgstr "پیادهسازی صحیح :c:member:`~PyTypeObject.tp_repr` برای نوعهای ظرف نیازمند مدیریت ویژهی بازگشت است. علاوه بر محافظت از پشته، :c:member:`~PyTypeObject.tp_repr` باید اشیاء را برای جلوگیری از چرخهها پیگیری کند. دو تابع زیر این عملکرد را تسهیل میکنند. در واقع، اینها معادل C برای :deco:`reprlib.recursive_repr` هستند."
msgid "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` implementation to detect cycles."
msgstr "در ابتدای پیادهسازی :c:member:`~PyTypeObject.tp_repr` برای تشخیص چرخهها فراخوانی میشود."
msgid "If the object has already been processed, the function returns a positive integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation should return a string object indicating a cycle. As examples, :class:`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``."
msgstr "اگر شیء قبلاً پردازش شده باشد، تابع یک عدد صحیح مثبت برمیگرداند. در این صورت، پیادهسازی :c:member:`~PyTypeObject.tp_repr` باید یک شیء رشته برگرداند که نشاندهندهی یک چرخه است. به عنوان مثال، شیءهای :class:`dict` ``{...}`` و شیءهای :class:`list` ``[...]`` را برمیگردانند."
msgid "The function will return a negative integer if the recursion limit is reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation should typically return ``NULL``."
msgstr "تابع در صورت رسیدن به حد بازگشتی، یک عدد صحیح منفی برمیگرداند. در این حالت، پیادهسازی :c:member:`~PyTypeObject.tp_repr` معمولاً باید ``NULL`` برگرداند."
msgid "Otherwise, the function returns zero and the :c:member:`~PyTypeObject.tp_repr` implementation can continue normally."
msgstr "در غیر این صورت، تابع صفر را برمیگرداند و پیادهسازی :c:member:`~PyTypeObject.tp_repr` میتواند بهطور عادی ادامه یابد."
msgid "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :c:func:`Py_ReprEnter` that returns zero."
msgstr "یک :c:func:`Py_ReprEnter` را به پایان میرساند. باید یکبار برای هر فراخوانی :c:func:`Py_ReprEnter` که صفر را برمیگرداند، فراخوانی شود."
msgid "Get the recursion limit for the current interpreter. It can be set with :c:func:`Py_SetRecursionLimit`. The recursion limit prevents the Python interpreter stack from growing infinitely."
msgstr "حد بازگشتی مفسر فعلی را برمیگرداند. این حد را میتوان با :c:func:`Py_SetRecursionLimit` تنظیم کرد. حد بازگشتی مانع از رشد بینهایت پشتهی مفسر پایتون میشود."
msgid "This function cannot fail, and the caller must hold an :term:`attached thread state`."
msgstr "این تابع نمیتواند شکست بخورد، و فراخوانکننده باید یک :term:`وضعیت نخ متصل <attached thread state>` را در اختیار داشته باشد."
msgid ":py:func:`sys.getrecursionlimit`"
msgstr ":py:func:`sys.getrecursionlimit`"
msgid "Set the recursion limit for the current interpreter."
msgstr "حد بازگشتی را برای مفسر فعلی تنظیم کنید."
msgid ":py:func:`sys.setrecursionlimit`"
msgstr ":py:func:`sys.setrecursionlimit`"
msgid "Exception and warning types"
msgstr "نوعهای استثنا و هشدار"
msgid "All standard Python exceptions and warning categories are available as global variables whose names are ``PyExc_`` followed by the Python exception name. These have the type :c:expr:`PyObject*`; they are all class objects."
msgstr "تمام استثناهای استاندارد پایتون و دستههای هشدار بهصورت متغیرهای سراسری در دسترس هستند که نام آنها ``PyExc_`` و به دنبال آن نام استثنای پایتون است. اینها از نوع :c:expr:`PyObject*` هستند؛ همگی اشیای کلاس هستند."
msgid "For completeness, here are all the variables:"
msgstr "برای کامل بودن، همه متغیرها اینجا آمدهاند:"
msgid "Exception types"
msgstr "نوعهای استثنا"
msgid "C name"
msgstr "نام C"
msgid "Python name"
msgstr "نام پایتونی"
msgid ":exc:`BaseException`"
msgstr ":exc:`BaseException`"
msgid ":exc:`BaseExceptionGroup`"
msgstr ":exc:`BaseExceptionGroup`"
msgid ":exc:`Exception`"
msgstr ":exc:`Exception`"
msgid ":exc:`ArithmeticError`"
msgstr ":exc:`ArithmeticError`"
msgid ":exc:`AssertionError`"
msgstr ":exc:`AssertionError`"
msgid ":exc:`AttributeError`"
msgstr ":exc:`AttributeError`"
msgid ":exc:`BlockingIOError`"
msgstr ":exc:`BlockingIOError`"
msgid ":exc:`BrokenPipeError`"
msgstr ":exc:`BrokenPipeError`"
msgid ":exc:`BufferError`"
msgstr ":exc:`BufferError`"
msgid ":exc:`ChildProcessError`"
msgstr ":exc:`ChildProcessError`"
msgid ":exc:`ConnectionAbortedError`"
msgstr ":exc:`ConnectionAbortedError`"
msgid ":exc:`ConnectionError`"
msgstr ":exc:`ConnectionError`"
msgid ":exc:`ConnectionRefusedError`"
msgstr ":exc:`ConnectionRefusedError`"
msgid ":exc:`ConnectionResetError`"
msgstr ":exc:`ConnectionResetError`"
msgid ":exc:`EOFError`"
msgstr ":exc:`EOFError`"
msgid ":exc:`FileExistsError`"
msgstr ":exc:`FileExistsError`"
msgid ":exc:`FileNotFoundError`"
msgstr ":exc:`FileNotFoundError`"
msgid ":exc:`FloatingPointError`"
msgstr ":exc:`FloatingPointError`"
msgid ":exc:`GeneratorExit`"
msgstr ":exc:`GeneratorExit`"
msgid ":exc:`ImportError`"
msgstr ":exc:`ImportError`"
msgid ":exc:`IndentationError`"
msgstr ":exc:`IndentationError`"
msgid ":exc:`IndexError`"
msgstr ":exc:`IndexError`"
msgid ":exc:`InterruptedError`"
msgstr ":exc:`InterruptedError`"
msgid ":exc:`IsADirectoryError`"
msgstr ":exc:`IsADirectoryError`"
msgid ":exc:`KeyError`"
msgstr ":exc:`KeyError`"
msgid ":exc:`KeyboardInterrupt`"
msgstr ":exc:`KeyboardInterrupt`"
msgid ":exc:`LookupError`"
msgstr ":exc:`LookupError`"
msgid ":exc:`MemoryError`"
msgstr ":exc:`MemoryError`"
msgid ":exc:`ModuleNotFoundError`"
msgstr ":exc:`ModuleNotFoundError`"
msgid ":exc:`NameError`"
msgstr ":exc:`NameError`"
msgid ":exc:`NotADirectoryError`"
msgstr ":exc:`NotADirectoryError`"
msgid ":exc:`NotImplementedError`"
msgstr ":exc:`NotImplementedError`"
msgid ":exc:`OSError`"
msgstr ":exc:`OSError`"
msgid ":exc:`OverflowError`"
msgstr ":exc:`OverflowError`"
msgid ":exc:`PermissionError`"
msgstr ":exc:`PermissionError`"
msgid ":exc:`ProcessLookupError`"
msgstr ":exc:`ProcessLookupError`"
msgid ":exc:`PythonFinalizationError`"
msgstr ":exc:`PythonFinalizationError`"
msgid ":exc:`RecursionError`"
msgstr ":exc:`RecursionError`"
msgid ":exc:`ReferenceError`"
msgstr ":exc:`ReferenceError`"
msgid ":exc:`RuntimeError`"
msgstr ":exc:`RuntimeError`"
msgid ":exc:`StopAsyncIteration`"
msgstr ":exc:`StopAsyncIteration`"
msgid ":exc:`StopIteration`"
msgstr ":exc:`StopIteration`"
msgid ":exc:`SyntaxError`"
msgstr ":exc:`SyntaxError`"
msgid ":exc:`SystemError`"
msgstr ":exc:`SystemError`"
msgid ":exc:`SystemExit`"
msgstr ":exc:`SystemExit`"
msgid ":exc:`TabError`"
msgstr ":exc:`TabError`"
msgid ":exc:`TimeoutError`"
msgstr ":exc:`TimeoutError`"
msgid ":exc:`TypeError`"
msgstr ":exc:`TypeError`"
msgid ":exc:`UnboundLocalError`"
msgstr ":exc:`UnboundLocalError`"
msgid ":exc:`UnicodeDecodeError`"
msgstr ":exc:`UnicodeDecodeError`"
msgid ":exc:`UnicodeEncodeError`"
msgstr ":exc:`UnicodeEncodeError`"
msgid ":exc:`UnicodeError`"
msgstr ":exc:`UnicodeError`"
msgid ":exc:`UnicodeTranslateError`"
msgstr ":exc:`UnicodeTranslateError`"
msgid ":exc:`ValueError`"
msgstr ":exc:`ValueError`"
msgid ":exc:`ZeroDivisionError`"
msgstr ":exc:`ZeroDivisionError`"
msgid ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:`PyExc_ConnectionAbortedError`, :c:data:`PyExc_ConnectionRefusedError`, :c:data:`PyExc_ConnectionResetError`, :c:data:`PyExc_FileExistsError`, :c:data:`PyExc_FileNotFoundError`, :c:data:`PyExc_InterruptedError`, :c:data:`PyExc_IsADirectoryError`, :c:data:`PyExc_NotADirectoryError`, :c:data:`PyExc_PermissionError`, :c:data:`PyExc_ProcessLookupError` and :c:data:`PyExc_TimeoutError` were introduced following :pep:`3151`."
msgstr ":c:data:`PyExc_BlockingIOError`، :c:data:`PyExc_BrokenPipeError`، :c:data:`PyExc_ChildProcessError`، :c:data:`PyExc_ConnectionError`، :c:data:`PyExc_ConnectionAbortedError`، :c:data:`PyExc_ConnectionRefusedError`، :c:data:`PyExc_ConnectionResetError`، :c:data:`PyExc_FileExistsError`، :c:data:`PyExc_FileNotFoundError`، :c:data:`PyExc_InterruptedError`، :c:data:`PyExc_IsADirectoryError`، :c:data:`PyExc_NotADirectoryError`، :c:data:`PyExc_PermissionError`، :c:data:`PyExc_ProcessLookupError` و :c:data:`PyExc_TimeoutError` در پی :pep:`3151` معرفی شدند."
msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`."
msgstr ":c:data:`PyExc_StopAsyncIteration` و :c:data:`PyExc_RecursionError`."
msgid ":c:data:`PyExc_ModuleNotFoundError`."
msgstr ":c:data:`PyExc_ModuleNotFoundError`."
msgid ":c:data:`PyExc_BaseExceptionGroup`."
msgstr ":c:data:`PyExc_BaseExceptionGroup`."
msgid "OSError aliases"
msgstr "نامهای مستعار OSError"
msgid "The following are a compatibility aliases to :c:data:`PyExc_OSError`."
msgstr "موارد زیر نامهای مستعار سازگاری برای :c:data:`PyExc_OSError` هستند."
msgid "These aliases used to be separate exception types."
msgstr "این نامهای مستعار قبلاً نوعهای استثنای جداگانه بودند."
msgid "Notes"
msgstr "یادداشتها"
msgid "[win]_"
msgstr "[win]_"
msgid "Notes:"
msgstr "یادداشتها:"
msgid ":c:var:`!PyExc_WindowsError` is only defined on Windows; protect code that uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined."
msgstr ":c:var:`!PyExc_WindowsError` تنها در ویندوز تعریف شده است؛ برای محافظت از کدی که از این استفاده میکند، بررسی کنید که ماکروی پیشپردازنده ``MS_WINDOWS`` تعریف شده باشد."
msgid "Warning types"
msgstr "انواع هشدار"
msgid ":exc:`Warning`"
msgstr ":exc:`Warning`"
msgid ":exc:`BytesWarning`"
msgstr ":exc:`BytesWarning`"
msgid ":exc:`DeprecationWarning`"
msgstr ":exc:`DeprecationWarning`"
msgid ":exc:`EncodingWarning`"
msgstr ":exc:`EncodingWarning`"
msgid ":exc:`FutureWarning`"
msgstr ":exc:`FutureWarning`"
msgid ":exc:`ImportWarning`"
msgstr ":exc:`ImportWarning`"
msgid ":exc:`PendingDeprecationWarning`"
msgstr ":exc:`PendingDeprecationWarning`"
msgid ":exc:`ResourceWarning`"
msgstr ":exc:`ResourceWarning`"
msgid ":exc:`RuntimeWarning`"
msgstr ":exc:`RuntimeWarning`"
msgid ":exc:`SyntaxWarning`"
msgstr ":exc:`SyntaxWarning`"
msgid ":exc:`UnicodeWarning`"
msgstr ":exc:`UnicodeWarning`"
msgid ":exc:`UserWarning`"
msgstr ":exc:`UserWarning`"
msgid ":c:data:`PyExc_ResourceWarning`."
msgstr ":c:data:`PyExc_ResourceWarning`."
msgid ":c:data:`PyExc_EncodingWarning`."
msgstr ":c:data:`PyExc_EncodingWarning`."
msgid "Tracebacks"
msgstr "ردگیریها"
msgid "Type object for traceback objects. This is available as :class:`types.TracebackType` in the Python layer."
msgstr "شیء نوع برای اشیاء ردگیری . این بهصورت :class:`types.TracebackType` در لایهی پایتون در دسترس است."
msgid "Return true if *op* is a traceback object, false otherwise. This function does not account for subtypes."
msgstr "اگر *op* یک شیء ردگیری باشد، مقدار true را برمیگرداند و در غیر این صورت مقدار false را. این تابع زیرنوعها را در نظر نمیگیرد."
msgid "Replace the :attr:`~BaseException.__traceback__` attribute on the current exception with a new traceback prepending *f* to the existing chain."
msgstr "ویژگی :attr:`~BaseException.__traceback__` روی استثنای فعلی را با یک ردگیری جدید که *f* را به ابتدای زنجیرهی موجود میافزاید، جایگزین کنید."
msgid "Calling this function without an exception set is undefined behavior."
msgstr "فراخوانی این تابع در حالی که استثنایی تنظیم نشده باشد، رفتار تعریفنشده است."
msgid "This function returns ``0`` on success, and returns ``-1`` with an exception set on failure."
msgstr "این تابع در صورت موفقیت ``0`` را برمیگرداند، و در صورت شکست ``-1`` را همراه با یک استثنای تنظیمشده برمیگرداند."
msgid "Write the traceback *tb* into the file *f*."
msgstr "ردگیری *tb* را در پرونده *f* بنویسید."
msgid "strerror (C function)"
msgstr "strerror (تابع C)"
msgid "module"
msgstr "ماژول"
msgid "signal"
msgstr "سیگنال"
msgid "SIGINT (C macro)"
msgstr "SIGINT (ماکروی C)"
msgid "KeyboardInterrupt (built-in exception)"
msgstr "KeyboardInterrupt (استثنای توکار)"