# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # Danial Behzadi , 2025 # Rafael Fontenelle , 2025 # Revisto , 2025 # Sepehr Rasouli , 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-14 15:52+0330\n" "Last-Translator: Sepehr Rasouli , 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 "Python Development Mode" msgstr "حالت توسعه پایتون" msgid "The Python Development Mode introduces additional runtime checks that are too expensive to be enabled by default. It should not be more verbose than the default if the code is correct; new warnings are only emitted when an issue is detected." msgstr "حالت توسعه پایتون، بررسی‌های ران‌تایم اضافی‌ای را ارائه می‌دهد که فعال بودن آن‌ها به‌طور پیش‌فرض بیش از حد پرهزینه است. اگر کد صحیح باشد، نباید پرجزئیات‌تر از حالت پیش‌فرض باشد؛ هشدارهای جدید تنها زمانی نشان داده می‌شوند که مشکلی شناسایی شود." msgid "It can be enabled using the :option:`-X dev <-X>` command line option or by setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``." msgstr "می‌توان آن را با استفاده از گزینه‌ی خط فرمان :option:`-X dev <-X>` یا با تنظیم متغیر محیطی :envvar:`PYTHONDEVMODE` روی ``1`` فعال کرد." msgid "See also :ref:`Python debug build `." msgstr "همچنین ببینید :ref:`ساخت اشکال‌زدایی پایتون `." msgid "Effects of the Python Development Mode" msgstr "اثرات حالت توسعه پایتون" msgid "Enabling the Python Development Mode is similar to the following command, but with additional effects described below::" msgstr "فعال‌سازی حالت توسعه پایتون مشابه دستور زیر است، اما با اثرات اضافی که در زیر شرح داده شده‌اند::" msgid "PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" msgstr "PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" msgid "Effects of the Python Development Mode:" msgstr "تأثیرات حالت توسعه پایتون:" msgid "Add ``default`` :ref:`warning filter `. The following warnings are shown:" msgstr "افزودن :ref:`فیلتر هشدار ` ``default``. هشدارهای زیر نمایش داده می‌شوند:" msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" msgid "Normally, the above warnings are filtered by the default :ref:`warning filters `." msgstr "معمولاً :ref:`فیلترهای هشدار ` پیش‌فرض، هشدارهای بالا را فیلتر می‌کنند." msgid "It behaves as if the :option:`-W default <-W>` command line option is used." msgstr "این‌گونه رفتار می‌کند که گویی گزینه خط فرمان :option:`-W default <-W>` استفاده شده است." msgid "Use the :option:`-W error <-W>` command line option or set the :envvar:`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as errors." msgstr "برای در نظر گرفتن هشدارها به‌عنوان خطا، از گزینه‌ی خط فرمان :option:`-W error <-W>` استفاده کنید یا متغیر محیطی :envvar:`PYTHONWARNINGS` را روی ``error`` تنظیم کنید." msgid "Install debug hooks on memory allocators to check for:" msgstr "برای بررسی، قلاب‌های اشکال‌زدایی را روی تخصیص‌دهنده‌های حافظه نصب کنید:" msgid "Buffer underflow" msgstr "زیرریز بافر (Buffer underflow)" msgid "Buffer overflow" msgstr "سرریز بافر" msgid "Memory allocator API violation" msgstr "نقض API تخصیص‌دهنده حافظه" msgid "Unsafe usage of the GIL" msgstr "استفاده‌ی ناایمن از GIL" msgid "See the :c:func:`PyMem_SetupDebugHooks` C function." msgstr "به تابع C :c:func:`PyMem_SetupDebugHooks` مراجعه کنید." msgid "It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to ``debug``." msgstr "به‌گونه‌ای رفتار می‌کند که گویی متغیر محیطی :envvar:`PYTHONMALLOC` روی ``debug`` تنظیم شده است." msgid "To enable the Python Development Mode without installing debug hooks on memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to ``default``." msgstr "برای فعال کردن حالت توسعه پایتون بدون نصب قلاب‌های اشکال‌زدایی روی تخصیص‌دهنده‌های حافظه، متغیر محیطی :envvar:`PYTHONMALLOC` را روی ``default`` تنظیم کنید." msgid "Call :func:`faulthandler.enable` at Python startup to install handlers for the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python traceback on a crash." msgstr "در زمان راه‌اندازی پایتون، :func:`faulthandler.enable` را فراخوانی کنید تا هندلرهایی برای سیگنال‌های :const:`~signal.SIGSEGV`، :const:`~signal.SIGFPE`، :const:`~signal.SIGABRT`، :const:`~signal.SIGBUS` و :const:`~signal.SIGILL` نصب شوند که در صورت فروپاشی، ردگیری پشته پایتون را برون‌ریزی می‌کنند." msgid "It behaves as if the :option:`-X faulthandler <-X>` command line option is used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to ``1``." msgstr "این به‌گونه‌ای رفتار می‌کند که گویی از گزینه‌ی خط فرمان :option:`-X faulthandler <-X>` استفاده شده باشد یا متغیر محیطی :envvar:`PYTHONFAULTHANDLER` روی ``1`` تنظیم شده باشد." msgid "Enable :ref:`asyncio debug mode `. For example, :mod:`asyncio` checks for coroutines that were not awaited and logs them." msgstr ":ref:`حالت اشکال‌زدایی asyncio ` را فعال کنید. برای مثال، :mod:`asyncio` هم‌روال‌هایی را که await نشده‌اند بررسی می‌کند و آن‌ها را ثبت می‌کند." msgid "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is set to ``1``." msgstr "این به‌گونه‌ای رفتار می‌کند که گویی متغیر محیطی :envvar:`PYTHONASYNCIODEBUG` روی ``1`` تنظیم شده است." msgid "Check the *encoding* and *errors* arguments for string encoding and decoding operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`." msgstr "آرگومان‌های *encoding* و *errors* را برای عملیات کدگذاری و کدگشایی رشته بررسی کنید. مثال‌ها: :func:`open`، :meth:`str.encode` و :meth:`bytes.decode`." msgid "By default, for best performance, the *errors* argument is only checked at the first encoding/decoding error and the *encoding* argument is sometimes ignored for empty strings." msgstr "به‌طور پیش‌فرض، برای بهترین عملکرد، آرگومان *errors* فقط در اولین خطای کدگذاری/کدگشایی بررسی می‌شود و آرگومان *encoding* گاهی برای رشته‌های خالی نادیده گرفته می‌شود." msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." msgstr "تخریب‌کننده‌ی :class:`io.IOBase` استثناهای ``close()`` را ثبت می‌کند." msgid "Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to ``True``." msgstr "ویژگی :attr:`~sys.flags.dev_mode` از :data:`sys.flags` را روی ``True`` تنظیم کنید." msgid "The Python Development Mode does not enable the :mod:`tracemalloc` module by default, because the overhead cost (to performance and memory) would be too large. Enabling the :mod:`tracemalloc` module provides additional information on the origin of some errors. For example, :exc:`ResourceWarning` logs the traceback where the resource was allocated, and a buffer overflow error logs the traceback where the memory block was allocated." msgstr "حالت توسعه پایتون به‌طور پیش‌فرض ماژول :mod:`tracemalloc` را فعال نمی‌کند، زیرا هزینه سربار (برای عملکرد و حافظه) بیش از حد زیاد خواهد بود. فعال‌سازی ماژول :mod:`tracemalloc` اطلاعات بیشتری درباره منشأ برخی خطاها فراهم می‌کند. برای مثال، :exc:`ResourceWarning` ردگیری پشته محل تخصیص منبع را ثبت می‌کند، و یک خطای سرریز بافر ردگیری پشته محل تخصیص بلوک حافظه را ثبت می‌کند." msgid "The Python Development Mode does not prevent the :option:`-O` command line option from removing :keyword:`assert` statements nor from setting :const:`__debug__` to ``False``." msgstr "حالت توسعه پایتون مانع از آن نمی‌شود که گزینه خط فرمان :option:`-O` دستورهای :keyword:`assert` را حذف کند یا :const:`__debug__` را روی ``False`` تنظیم کند." msgid "The Python Development Mode can only be enabled at the Python startup. Its value can be read from :data:`sys.flags.dev_mode `." msgstr "حالت توسعه پایتون را فقط می‌توان در هنگام راه‌اندازی پایتون فعال کرد. مقدار آن را می‌توان از :data:`sys.flags.dev_mode ` خواند." msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "تخریب‌کننده‌ی :class:`io.IOBase` اکنون استثناهای ``close()`` را ثبت می‌کند." msgid "The *encoding* and *errors* arguments are now checked for string encoding and decoding operations." msgstr "آرگومان‌های *encoding* و *errors* اکنون برای عملیات کدگذاری و کدگشایی رشته بررسی می‌شوند." msgid "ResourceWarning Example" msgstr "مثال ResourceWarning" msgid "Example of a script counting the number of lines of the text file specified in the command line::" msgstr "مثالی از یک اسکریپت برای شمارش تعداد سطرهای پرونده متنی مشخص‌شده در خط فرمان::" msgid "" "import sys\n" "\n" "def main():\n" " fp = open(sys.argv[1])\n" " nlines = len(fp.readlines())\n" " print(nlines)\n" " # The file is closed implicitly\n" "\n" "if __name__ == \"__main__\":\n" " main()" msgstr "" "import sys\n" "\n" "def main():\n" " fp = open(sys.argv[1])\n" " nlines = len(fp.readlines())\n" " print(nlines)\n" " # The file is closed implicitly\n" "\n" "if __name__ == \"__main__\":\n" " main()" msgid "The script does not close the file explicitly. By default, Python does not emit any warning. Example using README.txt, which has 269 lines:" msgstr "اسکریپت پرونده را به‌صراحت نمی‌بندد. به‌طور پیش‌فرض، پایتون هیچ هشداری نشان نمی‌دهند. مثالی با استفاده از README.txt که ۲۶۹ خط دارد:" msgid "" "$ python script.py README.txt\n" "269" msgstr "" "$ python script.py README.txt\n" "269" msgid "Enabling the Python Development Mode displays a :exc:`ResourceWarning` warning:" msgstr "فعال‌سازی حالت توسعه پایتون یک هشدار :exc:`ResourceWarning` را نمایش می‌دهد:" msgid "" "$ python -X dev script.py README.txt\n" "269\n" "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>\n" " main()\n" "ResourceWarning: Enable tracemalloc to get the object allocation traceback" msgstr "" "$ python -X dev script.py README.txt\n" "269\n" "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>\n" " main()\n" "ResourceWarning: Enable tracemalloc to get the object allocation traceback" msgid "In addition, enabling :mod:`tracemalloc` shows the line where the file was opened:" msgstr "علاوه بر این، فعال‌سازی :mod:`tracemalloc` سطری را نشان می‌دهد که پرونده در آن باز شده است:" msgid "" "$ python -X dev -X tracemalloc=5 script.py README.rst\n" "269\n" "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>\n" " main()\n" "Object allocated at (most recent call last):\n" " File \"script.py\", lineno 10\n" " main()\n" " File \"script.py\", lineno 4\n" " fp = open(sys.argv[1])" msgstr "" "$ python -X dev -X tracemalloc=5 script.py README.rst\n" "269\n" "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README.rst' mode='r' encoding='UTF-8'>\n" " main()\n" "Object allocated at (most recent call last):\n" " File \"script.py\", lineno 10\n" " main()\n" " File \"script.py\", lineno 4\n" " fp = open(sys.argv[1])" msgid "The fix is to close explicitly the file. Example using a context manager::" msgstr "راه‌حل این است که پرونده را به‌صورت صریح ببندید. مثال با استفاده از یک مدیر زمینه::" msgid "" "def main():\n" " # Close the file explicitly when exiting the with block\n" " with open(sys.argv[1]) as fp:\n" " nlines = len(fp.readlines())\n" " print(nlines)" msgstr "" "def main():\n" " # Close the file explicitly when exiting the with block\n" " with open(sys.argv[1]) as fp:\n" " nlines = len(fp.readlines())\n" " print(nlines)" msgid "Not closing a resource explicitly can leave a resource open for way longer than expected; it can cause severe issues upon exiting Python. It is bad in CPython, but it is even worse in PyPy. Closing resources explicitly makes an application more deterministic and more reliable." msgstr "نبستن یک منبع به‌طور صریح می‌تواند باعث شود آن منبع بسیار بیشتر از حد انتظار باز بماند؛ این موضوع می‌تواند هنگام خروج از Python مشکلات شدیدی ایجاد کند. این موضوع در CPython بد است، اما در PyPy حتی بدتر است. بستن منابع به‌طور صریح، یک برنامه را قطعی‌تر و قابل‌اعتمادتر می‌کند." msgid "Bad file descriptor error example" msgstr "مثال خطای توصیف‌گر پرونده نامعتبر" msgid "Script displaying the first line of itself::" msgstr "اسکریپتی که خط نخست خود را نمایش می‌دهد::" msgid "" "import os\n" "\n" "def main():\n" " fp = open(__file__)\n" " firstline = fp.readline()\n" " print(firstline.rstrip())\n" " os.close(fp.fileno())\n" " # The file is closed implicitly\n" "\n" "main()" msgstr "" "import os\n" "\n" "def main():\n" " fp = open(__file__)\n" " firstline = fp.readline()\n" " print(firstline.rstrip())\n" " os.close(fp.fileno())\n" " # The file is closed implicitly\n" "\n" "main()" msgid "By default, Python does not emit any warning:" msgstr "به‌طور پیش‌فرض، پایتون هیچ هشداری نشان نمی‌دهد:" msgid "" "$ python script.py\n" "import os" msgstr "" "$ python script.py\n" "import os" msgid "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad file descriptor\" error when finalizing the file object:" msgstr "حالت توسعه پایتون هنگام نهایی‌سازی شیء پرونده، یک :exc:`ResourceWarning` را نمایش می‌دهد و خطای «Bad file descriptor» را ثبت می‌کند:" msgid "" "$ python -X dev script.py\n" "import os\n" "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'>\n" " main()\n" "ResourceWarning: Enable tracemalloc to get the object allocation traceback\n" "Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'>\n" "Traceback (most recent call last):\n" " File \"script.py\", line 10, in \n" " main()\n" "OSError: [Errno 9] Bad file descriptor" msgstr "" "$ python -X dev script.py\n" "import os\n" "script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'>\n" " main()\n" "ResourceWarning: Enable tracemalloc to get the object allocation traceback\n" "Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' encoding='UTF-8'>\n" "Traceback (most recent call last):\n" " File \"script.py\", line 10, in \n" " main()\n" "OSError: [Errno 9] Bad file descriptor" msgid "``os.close(fp.fileno())`` closes the file descriptor. When the file object finalizer tries to close the file descriptor again, it fails with the ``Bad file descriptor`` error. A file descriptor must be closed only once. In the worst case scenario, closing it twice can lead to a crash (see :issue:`18748` for an example)." msgstr "``os.close(fp.fileno())`` توصیف‌گر پرونده را می‌بندد. هنگامی که نهایی‌ساز شیء پرونده تلاش می‌کند توصیف‌گر پرونده را دوباره ببندد، با خطای ``Bad file descriptor`` مواجه می‌شود. توصیف‌گر پرونده باید تنها یک بار بسته شود. در بدترین حالت، دو بار بستن آن می‌تواند منجر به فروپاشی شود (برای نمونه :issue:`18748` را ببینید)." msgid "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file with ``closefd=False``." msgstr "راه‌حل، حذف خط ``os.close(fp.fileno())`` یا باز کردن پرونده با ``closefd=False`` است."