@@ -984,12 +984,17 @@ msgid ""
984984" ``None``, if no data should be sent to the child. If streams were opened "
985985"in text mode, *input* must be a string. Otherwise, it must be bytes."
986986msgstr ""
987+ "与进程交互:向 stdin 传输数据。从 stdout 和 stderr 读取数据,直到文件结束符。等待进程终止。可选的 *input* "
988+ "参数应当未被传输给子进程的数据,如果没有数据应被传输给子进程则为 ``None``。如果流以文本模式打开, *input* "
989+ "必须为字符串。否则,它必须为字节。"
987990
988991#: ../../library/subprocess.rst:660
989992msgid ""
990993":meth:`communicate` returns a tuple ``(stdout_data, stderr_data)``. The data"
991994" will be strings if streams were opened in text mode; otherwise, bytes."
992995msgstr ""
996+ ":meth:`communicate` 返回一个 ``(stdout_data, stderr_data)`` "
997+ "元组。如果文件以文本模式打开则为字符串;否则字节。"
993998
994999#: ../../library/subprocess.rst:664
9951000msgid ""
@@ -998,60 +1003,69 @@ msgid ""
9981003"other than ``None`` in the result tuple, you need to give ``stdout=PIPE`` "
9991004"and/or ``stderr=PIPE`` too."
10001005msgstr ""
1006+ "注意如果你想要向进程的 stdin 传输数据,你需要通过 ``stdin=PIPE`` 创建此 Popen 对象。类似的,要从结果元组获取任何非 "
1007+ "``None`` 值,你同样需要设置 ``stdout=PIPE`` 或者 ``stderr=PIPE``。"
10011008
10021009#: ../../library/subprocess.rst:669
10031010msgid ""
10041011"If the process does not terminate after *timeout* seconds, a "
10051012":exc:`TimeoutExpired` exception will be raised. Catching this exception and"
10061013" retrying communication will not lose any output."
10071014msgstr ""
1015+ "如果进程在 *timeout* 秒后未终止,一个 :exc:`TimeoutExpired` 异常将被抛出。捕获此异常并重新等待将不会丢失任何输出。"
10081016
10091017#: ../../library/subprocess.rst:673
10101018msgid ""
10111019"The child process is not killed if the timeout expires, so in order to "
10121020"cleanup properly a well-behaved application should kill the child process "
10131021"and finish communication::"
1014- msgstr ""
1022+ msgstr "如果超时到期,子进程不会被杀死,所以为了正确清理一个行为良好的应用程序应该杀死子进程并完成通讯。 "
10151023
10161024#: ../../library/subprocess.rst:686
10171025msgid ""
10181026"The data read is buffered in memory, so do not use this method if the data "
10191027"size is large or unlimited."
1020- msgstr ""
1028+ msgstr "内存里数据读取是缓冲的,所以如果数据尺寸过大或无限,不要使用此方法。 "
10211029
10221030#: ../../library/subprocess.rst:695
10231031msgid "Sends the signal *signal* to the child."
1024- msgstr ""
1032+ msgstr "将信号 *signal* 发送给子进程。 "
10251033
10261034#: ../../library/subprocess.rst:699
10271035msgid ""
10281036"On Windows, SIGTERM is an alias for :meth:`terminate`. CTRL_C_EVENT and "
10291037"CTRL_BREAK_EVENT can be sent to processes started with a *creationflags* "
10301038"parameter which includes `CREATE_NEW_PROCESS_GROUP`."
10311039msgstr ""
1040+ "在 Windows, SIGTERM 是一个 :meth:`terminate` 的别名。 CTRL_C_EVENT 和 "
1041+ "CTRL_BREAK_EVENT 可以被发送给以包含 ``CREATE_NEW_PROCESS`` 的 *creationflags* 形参启动的进程。"
10321042
10331043#: ../../library/subprocess.rst:706
10341044msgid ""
10351045"Stop the child. On Posix OSs the method sends SIGTERM to the child. On "
10361046"Windows the Win32 API function :c:func:`TerminateProcess` is called to stop "
10371047"the child."
10381048msgstr ""
1049+ "停止子进程。在 Posix 操作系统上,此方法发送 SIGTERM。在 Windows,调用 Win32 API 函数 "
1050+ ":c:func:`TerminateProcess` 来停止子进程。"
10391051
10401052#: ../../library/subprocess.rst:713
10411053msgid ""
10421054"Kills the child. On Posix OSs the function sends SIGKILL to the child. On "
10431055"Windows :meth:`kill` is an alias for :meth:`terminate`."
10441056msgstr ""
1057+ "杀死子进程。在 Posix 操作系统上,此函数发送 SIGKILL。在 Windows, :meth:`kill` 是 "
1058+ ":meth;`terminate` 的别名。"
10451059
10461060#: ../../library/subprocess.rst:717
10471061msgid "The following attributes are also available:"
1048- msgstr ""
1062+ msgstr "以下属性也是可用的: "
10491063
10501064#: ../../library/subprocess.rst:721
10511065msgid ""
10521066"The *args* argument as it was passed to :class:`Popen` -- a sequence of "
10531067"program arguments or else a single string."
1054- msgstr ""
1068+ msgstr "*args* 参数传递给 :class:`Popen` -- 一个程序参数的序列或者一个简单字符串。 "
10551069
10561070#: ../../library/subprocess.rst:728
10571071msgid ""
@@ -1061,6 +1075,9 @@ msgid ""
10611075"the stream is a text stream, otherwise it is a byte stream. If the *stdin* "
10621076"argument was not :data:`PIPE`, this attribute is ``None``."
10631077msgstr ""
1078+ "如果 *stdin* 参数为 :data:`PIPE`,此属性是一个类似 :func:`open` 返回的可写的流对象。如果 *encoding* 或 "
1079+ "*errors* 参数被指定或者 *universal_newlines* 参数为 ``True``,则此流是一个文本流,否则是字节流。如果 "
1080+ "*stdin* 参数非 :data:`PIPE`, 此属性为 ``None``。"
10641081
10651082#: ../../library/subprocess.rst:737
10661083msgid ""
@@ -1071,6 +1088,9 @@ msgid ""
10711088" text stream, otherwise it is a byte stream. If the *stdout* argument was "
10721089"not :data:`PIPE`, this attribute is ``None``."
10731090msgstr ""
1091+ "如果 *stdout* 参数是 :data:`PIPE`,此属性是一个类似 :func:`open` 返回的可读流。从流中读取子进程提供的输出。如果 "
1092+ "*encoding* 或 *errors* 参数被指定或者 *universal_newlines* 参数为 "
1093+ "``True``,此流为文本流,否则为字节流。如果 *stdout* 参数非 :data:`PIPE`,此属性为 ``None``。"
10741094
10751095#: ../../library/subprocess.rst:747
10761096msgid ""
@@ -1081,6 +1101,9 @@ msgid ""
10811101"stream is a text stream, otherwise it is a byte stream. If the *stderr* "
10821102"argument was not :data:`PIPE`, this attribute is ``None``."
10831103msgstr ""
1104+ "如果 *stderr* 参数是 :data:`PIPE`,此属性是一个类似 :func:`open` 返回的可读流。从流中读取子进程提供的输出。如果 "
1105+ "*encoding* 或 *errors* 参数被指定或者 *universal_newlines* 参数为 "
1106+ "``True``,此流为文本流,否则为字节流。如果 *stderr* 参数非 :data:`PIPE`,此属性为 ``None``。"
10841107
10851108#: ../../library/subprocess.rst:756
10861109msgid ""
@@ -1089,33 +1112,38 @@ msgid ""
10891112"<Popen.stderr>` to avoid deadlocks due to any of the other OS pipe buffers "
10901113"filling up and blocking the child process."
10911114msgstr ""
1115+ "使用 :meth:`~Popen.communicate` 而非 :attr:`.stdin.write <Popen.stdin>`, "
1116+ ":attr:`.stdout.read <Popen.stdout>` 或者 :attr:`.stderr.read <Popen.stderr>` "
1117+ "来避免由于任意其他 OS 管道缓冲区被子进程填满阻塞而导致的死锁。"
10921118
10931119#: ../../library/subprocess.rst:764
10941120msgid "The process ID of the child process."
1095- msgstr ""
1121+ msgstr "子进程的进程号。 "
10961122
10971123#: ../../library/subprocess.rst:766
10981124msgid ""
10991125"Note that if you set the *shell* argument to ``True``, this is the process "
11001126"ID of the spawned shell."
1101- msgstr ""
1127+ msgstr "注意如果你设置了 *shell* 参数为 ``True``,则这是生成的子 shell 的进程号。 "
11021128
11031129#: ../../library/subprocess.rst:772
11041130msgid ""
11051131"The child return code, set by :meth:`poll` and :meth:`wait` (and indirectly "
11061132"by :meth:`communicate`). A ``None`` value indicates that the process hasn't"
11071133" terminated yet."
11081134msgstr ""
1135+ "此进程的退出码,由 :meth:`poll` 和 :meth:`wait` 设置(以及直接由 :meth:`communicate` 设置)。一个 "
1136+ "``None`` 值 表示此进程仍未结束。"
11091137
11101138#: ../../library/subprocess.rst:781
11111139msgid "Windows Popen Helpers"
1112- msgstr ""
1140+ msgstr "Windows Popen 助手 "
11131141
11141142#: ../../library/subprocess.rst:783
11151143msgid ""
11161144"The :class:`STARTUPINFO` class and following constants are only available on"
11171145" Windows."
1118- msgstr ""
1146+ msgstr ":class:`STARTUPINFO` 类和以下常数仅在 Windows 有效。 "
11191147
11201148#: ../../library/subprocess.rst:789
11211149msgid ""
0 commit comments