@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.15\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2026-09-21 18:58 +0000\n "
14+ "POT-Creation-Date : 2026-09-25 18:08 +0000\n "
1515"PO-Revision-Date : 2025-09-16 00:00+0000\n "
1616"Last-Translator : python-doc bot, 2025\n "
1717"Language-Team : Russian (https://app.transifex.com/python-doc/teams/5390/ "
@@ -33,8 +33,8 @@ msgid ""
3333msgstr ""
3434
3535msgid ""
36- "Most platforms require elevated privileges to attach to another Python "
37- "process ."
36+ "Attaching to another Python process may require additional permissions or "
37+ "configuration, depending on the platform ."
3838msgstr ""
3939
4040msgid "Disabling remote debugging"
@@ -58,56 +58,120 @@ msgid "Permission requirements"
5858msgstr ""
5959
6060msgid ""
61- "Attaching to a running Python process for remote debugging requires elevated "
62- "privileges on most platforms. The specific requirements and troubleshooting "
63- "steps depend on your operating system:"
61+ "Attaching to a running Python process for remote debugging requires special "
62+ "configuration on most platforms. The specific requirements and "
63+ "troubleshooting steps depend on your operating system:"
6464msgstr ""
6565
6666msgid "Linux"
6767msgstr ""
6868
6969msgid ""
70- "The tracer process must have the ``CAP_SYS_PTRACE`` capability or equivalent "
71- "privileges. You can only trace processes you own and can signal. Tracing may "
72- "fail if the process is already being traced, or if it is running with set- "
73- "user-ID or set-group-ID. Security modules like Yama may further restrict "
74- "tracing. "
70+ "In general, you can debug your own processes, but there are several common "
71+ "configurations that may disable this. Some Linux distributions enable "
72+ "**ptrace restrictions**, aka \" Yama, \" as a form of system hardening. Recent "
73+ "versions of the ``setpriv`` command (util-linux 2.41, released June 2025) "
74+ "let you loosen ptrace restrictions on a per-process basis: "
7575msgstr ""
7676
77- msgid "To temporarily relax ptrace restrictions (until reboot), run:"
77+ msgid "``setpriv --ptracer any python3``"
78+ msgstr ""
79+
80+ msgid ""
81+ "(This is configured on the process *being debugged*.) You can also turn off "
82+ "ptrace restrictions for all processes until reboot with:"
7883msgstr ""
7984
8085msgid "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``"
8186msgstr ""
8287
88+ msgid "This can also be configured persistently, usually in ``/etc/sysctl.d``."
89+ msgstr ""
90+
8391msgid ""
8492"Disabling ``ptrace_scope`` reduces system hardening and should only be done "
85- "in trusted environments."
93+ "in low-security environments."
94+ msgstr ""
95+
96+ msgid ""
97+ "It is also possible that the ``ptrace`` system call is disabled because of a "
98+ "security filter. In particular, this was common with older versions of some "
99+ "container software. Docker 19.03 or newer (released 2019) and containerd "
100+ "1.6.7 or newer (released 2022) will automatically allow usage of the "
101+ "``ptrace`` system call inside containers, when running on Linux kernel 4.8 "
102+ "or higher. If you cannot upgrade to these versions, you can create your "
103+ "container with an option like ``--security-opt seccomp=unconfined`` to "
104+ "disable the system call security filter for that container. This weakens the "
105+ "container's isolation and should only be done in low-security environments."
86106msgstr ""
87107
88108msgid ""
89- "If running inside a container, use ``--cap-add=SYS_PTRACE`` or ``--"
90- "privileged``, and run as root if needed."
109+ "If you need to trace a process that you *do not* own, you will need "
110+ "superuser access or equivalent. This also applies to processes that have "
111+ "changed their security credentials, e.g., set-user-ID or set-group-ID "
112+ "processes (though this is unusual for Python). Try running the debugging "
113+ "command with ``sudo -E``."
91114msgstr ""
92115
93- msgid "Try re-running the command with elevated privileges:"
116+ msgid ""
117+ "The ``CAP_SYS_PTRACE`` capability is equivalent to superuser access, in that "
118+ "it allows debugging *any* process, not just your own. You may see advice on "
119+ "the internet suggesting using it to work around ptrace restrictions or "
120+ "system call filters. This may work in practice, as would ``sudo``, but this "
121+ "gives the debugging process much more access than it needs and should only "
122+ "be done in low-security environments."
94123msgstr ""
95124
96- msgid "``sudo -E !!``"
125+ msgid ""
126+ "Finally, note that a process can only have one tracer at a time. If you have "
127+ "already attached to a Python process under ``strace``, ``gdb``, etc., you "
128+ "won't be able to simultaneously use remote debugging. (Superuser access "
129+ "cannot get around this restriction.)"
97130msgstr ""
98131
99132msgid "macOS"
100133msgstr ""
101134
135+ msgid "By default, macOS disables the ability to debug other processes."
136+ msgstr ""
137+
138+ msgid ""
139+ "You can modify your Python binary to opt in to being debugged by giving it "
140+ "an **ad-hoc code signature** with an **entitlement** enabling it to be "
141+ "debugged. (An ad-hoc \" signature\" is just a configuration without any "
142+ "actual cryptographic signature or a need for a certificate or anything else "
143+ "such as an Apple developer program membership.)"
144+ msgstr ""
145+
146+ msgid ""
147+ "The following commands will create a file ``get-task-allow.plist`` with the "
148+ "necessary entitlement and add it to the Python binary:"
149+ msgstr ""
150+
151+ msgid ""
152+ "echo '{\" com.apple.security.get-task-allow\" : true}' | plutil -convert xml1 -"
153+ "o get-task-allow.plist -\n"
154+ "codesign --sign - --entitlements get-task-allow.plist path/to/bin/python3"
155+ msgstr ""
156+
157+ msgid ""
158+ "where ``path/to/bin/python3`` is the path to your Python binary, which you "
159+ "can find by e.g. running ``which python3`` or evaluating ``sys."
160+ "base_executable`` at the Python REPL. (These instructions are for a non-"
161+ "framework build of Python. Framework builds may need to be configured "
162+ "differently.)"
163+ msgstr ""
164+
102165msgid ""
103- "To attach to another process, you typically need to run your debugging tool "
104- "with elevated privileges. This can be done by using ``sudo`` or running as "
105- "root."
166+ "You should then be able to debug your own Python processes started with that "
167+ "binary."
106168msgstr ""
107169
108170msgid ""
109- "Even when attaching to processes you own, macOS may block debugging unless "
110- "the debugger is run with root privileges due to system security restrictions."
171+ "Alternatively, much as with Linux, processes with superuser privileges e.g. "
172+ "``sudo`` are not subject to this check and can debug any user's process on "
173+ "the system (though there are additional checks on specific binaries, such as "
174+ "OS-provided commands, due to System Integrity Protection)."
111175msgstr ""
112176
113177msgid "Windows"
0 commit comments