File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- {"translation" : " 89.54%" , "updated_at" : " 2023-08-10T10 :56:32Z " }
1+ {"translation" : " 89.54%" , "updated_at" : " 2023-08-10T15 :56:33Z " }
Original file line number Diff line number Diff line change @@ -890,6 +890,11 @@ msgid ""
890890"*dirnames* have already been generated by the time *dirnames* is yielded to "
891891"the caller."
892892msgstr ""
893+ "当 *top_down* 为真值时,调用者可以就地修改 *dirnames* 列表(例如,使用 :keyword:`del` 或切片赋值),而 "
894+ ":meth:`Path.walk` 将只向名称保留在 *dirnames* 中的子目录递归。 这可用于减少搜索量,或加入特定的访问顺序,甚至是在继续 "
895+ ":meth:`Path.walk` 之前通知 :meth:`Path.walk` 调用者创建或重命名的目录的相关信息。 当 *top_down* "
896+ "为假值时修改 *dirnames* 不会影响 :meth:`Path.walk()` 的行为,因为在 *dirnames* 被提供给调用者时 "
897+ "*dirnames* 中的目录已经生成了。"
893898
894899#: ../../library/pathlib.rst:1084
895900msgid ""
@@ -899,6 +904,9 @@ msgid ""
899904"error to continue the walk or re-raise it to stop the walk. Note that the "
900905"filename is available as the ``filename`` attribute of the exception object."
901906msgstr ""
907+ "在默认情况下,来自 :func:`os.scandir` 的错误将被忽略。 如果指定了可选参数 "
908+ "*on_error*,则它应为一个可调用对象;调用它需要传入一个参数,即 :exc:`OSError` 的实例。 "
909+ "该可调用对象能处理错误以继续执行遍历或是重新引发错误以停止遍历。 请注意可以通过异常对象的 ``filename`` 属性来获取文件名。"
902910
903911#: ../../library/pathlib.rst:1090
904912msgid ""
You can’t perform that action at this time.
0 commit comments