1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2021 , Python Software Foundation
2
+ # Copyright (C) 2001-2024 , Python Software Foundation
3
3
# This file is distributed under the same license as the Python package.
4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
7
# Arisaka97 <solitaire2312@gmail.com>, 2020
8
8
# ppcfish <ppcfish@gmail.com>, 2020
9
- # Freesand Leo <yuqinju@163.com>, 2021
9
+ # Freesand Leo <yuqinju@163.com>, 2024
10
10
#
11
11
#, fuzzy
12
12
msgid ""
13
13
msgstr ""
14
14
"Project-Id-Version : Python 3.8\n "
15
15
"Report-Msgid-Bugs-To : \n "
16
- "POT-Creation-Date : 2021-07-21 17:59 +0000\n "
16
+ "POT-Creation-Date : 2024-02-09 23:30 +0000\n "
17
17
"PO-Revision-Date : 2020-05-30 12:09+0000\n "
18
- "Last-Translator : Freesand Leo <yuqinju@163.com>, 2021 \n "
19
- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
18
+ "Last-Translator : Freesand Leo <yuqinju@163.com>, 2024 \n "
19
+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
20
20
"MIME-Version : 1.0\n "
21
21
"Content-Type : text/plain; charset=UTF-8\n "
22
22
"Content-Transfer-Encoding : 8bit\n "
@@ -73,7 +73,7 @@ msgid ""
73
73
"the *fsrc* object is not 0, only the contents from the current file position"
74
74
" to the end of the file will be copied."
75
75
msgstr ""
76
- "将文件类对象 *fsrc* 的内容拷贝到文件类对象 *fdst*。 整数值 *length* 如果给出则为缓冲区大小。 特别地, *length* "
76
+ "将文件型对象 *fsrc* 的内容拷贝到文件型对象 *fdst*。 整数值 *length* 如果给出则为缓冲区大小。 特别地, *length* "
77
77
"为负值表示拷贝数据时不对源数据进行分块循环处理;默认情况下会分块读取数据以避免不受控制的内存消耗。 请注意如果 *fsrc* 对象的当前文件位置不为 "
78
78
"0,则只有从当前文件位置到文件末尾的内容会被拷贝。"
79
79
@@ -842,7 +842,7 @@ msgid ""
842
842
"returned sequence is a tuple ``(name, description)``."
843
843
msgstr "返回支持的归档格式列表。 所返回序列中的每个元素为一个元组 ``(name, description)``。"
844
844
845
- #: ../../library/shutil.rst:609 ../../library/shutil.rst:691
845
+ #: ../../library/shutil.rst:609 ../../library/shutil.rst:712
846
846
msgid "By default :mod:`shutil` provides these formats:"
847
847
msgstr "默认情况下 :mod:`shutil` 提供以下格式:"
848
848
@@ -855,15 +855,15 @@ msgid ""
855
855
"*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives."
856
856
msgstr "*tar*: 未压缩的 tar 文件。 对于新归档文件将使用 POSIX.1-2001 pax 格式。"
857
857
858
- #: ../../library/shutil.rst:613 ../../library/shutil.rst:696
858
+ #: ../../library/shutil.rst:613 ../../library/shutil.rst:717
859
859
msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)."
860
860
msgstr "*gztar*: gzip 压缩的 tar 文件(如果 :mod:`zlib` 模块可用)。"
861
861
862
- #: ../../library/shutil.rst:614 ../../library/shutil.rst:697
862
+ #: ../../library/shutil.rst:614 ../../library/shutil.rst:718
863
863
msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)."
864
864
msgstr "*bztar*: bzip2 压缩的 tar 文件(如果 :mod:`bz2` 模块可用)。"
865
865
866
- #: ../../library/shutil.rst:615 ../../library/shutil.rst:698
866
+ #: ../../library/shutil.rst:615 ../../library/shutil.rst:719
867
867
msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)."
868
868
msgstr "*xztar*: xz 压缩的 tar 文件(如果 :mod:`lzma` 模块可用)。"
869
869
@@ -930,90 +930,128 @@ msgstr ""
930
930
"或者任何通过 :func:`register_unpack_format` 注册的其他格式。 如果未提供,:func:`unpack_archive` "
931
931
"将使用归档文件的扩展名来检查是否注册了对应于该扩展名的解包器。 在未找到任何解包器的情况下,将引发 :exc:`ValueError`。"
932
932
933
- #: ../../library/shutil.rst:658
933
+ #: ../../library/shutil.rst:657
934
+ msgid ""
935
+ "The keyword-only *filter* argument, which was added in Python 3.8.17, is "
936
+ "passed to the underlying unpacking function. For zip files, *filter* is not "
937
+ "accepted. For tar files, it is recommended to set it to ``'data'``, unless "
938
+ "using features specific to tar and UNIX-like filesystems. (See "
939
+ ":ref:`tarfile-extraction-filter` for details.) The ``'data'`` filter will "
940
+ "become the default for tar files in Python 3.14."
941
+ msgstr ""
942
+
943
+ #: ../../library/shutil.rst:667
934
944
msgid ""
935
945
"Raises an :ref:`auditing event <auditing>` ``shutil.unpack_archive`` with "
936
946
"arguments ``filename``, ``extract_dir``, ``format``."
937
947
msgstr ""
938
948
"引发一个 :ref:`审计事件 <auditing>` ``shutil.unpack_archive`` 附带参数 ``filename``, "
939
949
"``extract_dir``, ``format``。"
940
950
941
- #: ../../library/shutil.rst:659
951
+ #: ../../library/shutil.rst:670
952
+ msgid ""
953
+ "Never extract archives from untrusted sources without prior inspection. It "
954
+ "is possible that files are created outside of the path specified in the "
955
+ "*extract_dir* argument, e.g. members that have absolute filenames starting "
956
+ "with \" /\" or filenames with two dots \" ..\" ."
957
+ msgstr ""
958
+ "绝不要未经预先检验就从不可靠的源中提取归档文件。 这样有可能会在 *extract_dir* 参数所指定的路径之外创建文件,例如某些成员具有以 "
959
+ "\" /\" 打头的绝对路径文件名或是以两个点号 \" ..\" 打头的文件名。"
960
+
961
+ #: ../../library/shutil.rst:675
942
962
msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*."
943
963
msgstr "接受一个 :term:`path-like object` 作为 *filename* 和 *extract_dir*。"
944
964
945
- #: ../../library/shutil.rst:665
965
+ #: ../../library/shutil.rst:678
966
+ msgid "Added the *filter* argument."
967
+ msgstr "增加了 *filter* 参数。"
968
+
969
+ #: ../../library/shutil.rst:683
946
970
msgid ""
947
971
"Registers an unpack format. *name* is the name of the format and "
948
972
"*extensions* is a list of extensions corresponding to the format, like "
949
973
"``.zip`` for Zip files."
950
974
msgstr ""
951
975
"注册一个解包格式。 *name* 为格式名称而 *extensions* 为对应于该格式的扩展名列表,例如 Zip 文件的扩展名为 ``.zip``。"
952
976
953
- #: ../../library/shutil.rst:669
977
+ #: ../../library/shutil.rst:687
954
978
msgid ""
955
979
"*function* is the callable that will be used to unpack archives. The "
956
- "callable will receive the path of the archive, followed by the directory the"
957
- " archive must be extracted to."
958
- msgstr "*function* 是将被用来解包归档文件的可调用对象。 该可调用对象将接受归档文件的路径,加上该归档文件要被解包的目标目录。"
980
+ "callable will receive:"
981
+ msgstr "*function* 是将被用于解包归档的可调用对象。 该可调用对象将接受:"
982
+
983
+ #: ../../library/shutil.rst:690
984
+ msgid "the path of the archive, as a positional argument;"
985
+ msgstr "归档的路径,为位置参数;"
986
+
987
+ #: ../../library/shutil.rst:691
988
+ msgid ""
989
+ "the directory the archive must be extracted to, as a positional argument;"
990
+ msgstr "归档要提取到的目录,为位置参数;"
959
991
960
- #: ../../library/shutil.rst:673
992
+ #: ../../library/shutil.rst:692
961
993
msgid ""
962
- "When provided, *extra_args* is a sequence of ``(name, value)`` tuples that "
963
- "will be passed as keywords arguments to the callable. "
964
- msgstr "如果提供了 *extra_args*,则其应为一个 ``(name, value)`` 元组的序列,将被作为关键字参数传递给该可调用对象。 "
994
+ "possibly a *filter* keyword argument, if it was given to "
995
+ ":func:`unpack_archive`; "
996
+ msgstr "可选的 *filter* 关键字参数,如果有提供给 :func:`unpack_archive` 的话; "
965
997
966
- #: ../../library/shutil.rst:676
998
+ #: ../../library/shutil.rst:694
999
+ msgid ""
1000
+ "additional keyword arguments, specified by *extra_args* as a sequence of "
1001
+ "``(name, value)`` tuples."
1002
+ msgstr "额外的关键字参数,由 ``(name, value)`` 元组组成的序列 *extra_args* 指明。"
1003
+
1004
+ #: ../../library/shutil.rst:697
967
1005
msgid ""
968
1006
"*description* can be provided to describe the format, and will be returned "
969
1007
"by the :func:`get_unpack_formats` function."
970
1008
msgstr "可以提供 *description* 来描述该格式,它将被 :func:`get_unpack_formats` 返回。"
971
1009
972
- #: ../../library/shutil.rst:682
1010
+ #: ../../library/shutil.rst:703
973
1011
msgid "Unregister an unpack format. *name* is the name of the format."
974
1012
msgstr "撤销注册一个解包格式。 *name* 为格式的名称。"
975
1013
976
- #: ../../library/shutil.rst:687
1014
+ #: ../../library/shutil.rst:708
977
1015
msgid ""
978
1016
"Return a list of all registered formats for unpacking. Each element of the "
979
1017
"returned sequence is a tuple ``(name, extensions, description)``."
980
1018
msgstr "返回所有已注册的解包格式列表。 所返回序列中的每个元素为一个元组 ``(name, extensions, description)``。"
981
1019
982
- #: ../../library/shutil.rst:693
1020
+ #: ../../library/shutil.rst:714
983
1021
msgid ""
984
1022
"*zip*: ZIP file (unpacking compressed files works only if the corresponding "
985
1023
"module is available)."
986
1024
msgstr "*zip*: ZIP 文件(只有在相应模块可用时才能解包压缩文件)。"
987
1025
988
- #: ../../library/shutil.rst:695
1026
+ #: ../../library/shutil.rst:716
10000
span>
989
1027
msgid "*tar*: uncompressed tar file."
990
1028
msgstr "*tar*: 未压缩的 tar 文件。"
991
1029
992
- #: ../../library/shutil.rst:700
1030
+ #: ../../library/shutil.rst:721
993
1031
msgid ""
994
1032
"You can register new formats or provide your own unpacker for any existing "
995
1033
"formats, by using :func:`register_unpack_format`."
996
1034
msgstr "你可以通过使用 :func:`register_unpack_format` 注册新的格式或为任何现有格式提供你自己的解包器。"
997
1035
998
- #: ../../library/shutil.rst:707
1036
+ #: ../../library/shutil.rst:728
999
1037
msgid "Archiving example"
1000
1038
msgstr "归档程序示例"
1001
1039
1002
- #: ../../library/shutil.rst:709
1040
+ #: ../../library/shutil.rst:730
1003
1041
msgid ""
1004
1042
"In this example, we create a gzip'ed tar-file archive containing all files "
1005
1043
"found in the :file:`.ssh` directory of the user::"
1006
1044
msgstr "在这个示例中,我们创建了一个 gzip 压缩的 tar 归档文件,其中包含用户的 :file:`.ssh` 目录下的所有文件::"
1007
1045
1008
- #: ../../library/shutil.rst:719
1046
+ #: ../../library/shutil.rst:740
1009
1047
msgid "The resulting archive contains:"
1010
1048
msgstr "结果归档文件中包含有:"
1011
1049
1012
- #: ../../library/shutil.rst:737
1050
+ #: ../../library/shutil.rst:758
1013
1051
msgid "Archiving example with *base_dir*"
1014
1052
msgstr "使用 *base_dir* 的归档程序示例"
1015
1053
1016
- #: ../../library/shutil.rst:739
1054
+ #: ../../library/shutil.rst:760
1017
1055
msgid ""
1018
1056
"In this example, similar to the `one above <shutil-archiving-example_>`_, we"
1019
1057
" show how to use :func:`make_archive`, but this time with the usage of "
@@ -1022,35 +1060,35 @@ msgstr ""
1022
1060
"在这个例子中,与 `上面的例子 <shutil-archiving-example_>`_ 类似,我们演示了如何使用 "
1023
1061
":func:`make_archive`,但这次是使用 *base_dir*。 我们现在具有如下的目录结构:"
1024
1062
1025
- #: ../../library/shutil.rst:753
1063
+ #: ../../library/shutil.rst:774
1026
1064
msgid ""
1027
1065
"In the final archive, :file:`please_add.txt` should be included, but "
1028
1066
":file:`do_not_add.txt` should not. Therefore we use the following::"
1029
1067
msgstr ""
1030
1068
"在最终的归档中,应当会包括 :file:`please_add.txt`,但不应当包括 :file:`do_not_add.txt`。 "
1031
1069
"因此我们使用以下代码::"
1032
1070
1033
- #: ../../library/shutil.rst:767
1071
+ #: ../../library/shutil.rst:788
1034
1072
msgid "Listing the files in the resulting archive gives us:"
1035
1073
msgstr "列出结果归档中的文件我们将会得到:"
1036
1074
1037
- #: ../../library/shutil.rst:777
1075
+ #: ../../library/shutil.rst:798
1038
1076
msgid "Querying the size of the output terminal"
1039
1077
msgstr "查询输出终端的尺寸"
1040
1078
1041
- #: ../../library/shutil.rst:781
1079
+ #: ../../library/shutil.rst:802
1042
1080
msgid "Get the size of the terminal window."
1043
1081
msgstr "获取终端窗口的尺寸。"
1044
1082
1045
- #: ../../library/shutil.rst:783
1083
+ #: ../../library/shutil.rst:804
1046
1084
msgid ""
1047
1085
"For each of the two dimensions, the environment variable, ``COLUMNS`` and "
1048
1086
"``LINES`` respectively, is checked. If the variable is defined and the value"
1049
1087
" is a positive integer, it is used."
1050
1088
msgstr ""
1051
1089
"对于两个维度中的每一个,会分别检查环境变量 ``COLUMNS`` 和 ``LINES``。 如果定义了这些变量并且其值为正整数,则将使用这些值。"
1052
1090
1053
- #: ../../library/shutil.rst:787
1091
+ #: ../../library/shutil.rst:808
1054
1092
msgid ""
1055
1093
"When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the "
1056
1094
"terminal connected to :data:`sys.__stdout__` is queried by invoking "
@@ -1059,7 +1097,7 @@ msgstr ""
1059
1097
"如果未定义 ``COLUMNS`` 或 ``LINES``,这是通常的情况,则连接到 :data:`sys.__stdout__` 的终端将通过发起调用"
1060
1098
" :func:`os.get_terminal_size` 被查询。"
1061
1099
1062
- #: ../../library/shutil.rst:791
1100
+ #: ../../library/shutil.rst:812
1063
1101
msgid ""
1064
1102
"If the terminal size cannot be successfully queried, either because the "
1065
1103
"system doesn't support querying, or because we are not connected to a "
@@ -1070,11 +1108,11 @@ msgstr ""
1070
1108
"如果由于系统不支持查询,或是由于我们未连接到某个终端而导致查询终端尺寸不成功,则会使用在 ``fallback`` 形参中给出的值。 "
1071
1109
"``fallback`` 默认为 ``(80, 24)``,这是许多终端模拟器所使用的默认尺寸。"
1072
1110
1073
- #: ../../library/shutil.rst:797
1111
+ #: ../../library/shutil.rst:818
1074
1112
msgid "The value returned is a named tuple of type :class:`os.terminal_size`."
1075
1113
msgstr "返回的值是一个 :class:`os.terminal_size` 类型的具名元组。"
1076
1114
1077
- #: ../../library/shutil.rst:799
1115
+ #: ../../library/shutil.rst:820
1078
1116
msgid ""
1079
1117
"See also: The Single UNIX Specification, Version 2, `Other Environment "
1080
1118
"Variables`_."
0 commit comments