-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathshutil.po
1122 lines (969 loc) · 54.8 KB
/
shutil.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Arisaka97 <[email protected]>, 2020
# ppcfish <[email protected]>, 2020
# Freesand Leo <[email protected]>, 2024
# Rafael Fontenelle <[email protected]>, 2024
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.8\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-31 13:50+0000\n"
"PO-Revision-Date: 2020-05-30 12:09+0000\n"
"Last-Translator: Rafael Fontenelle <[email protected]>, 2024\n"
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/shutil.rst:2
msgid ":mod:`shutil` --- High-level file operations"
msgstr ":mod:`shutil` --- 高阶文件操作"
#: ../../library/shutil.rst:10
msgid "**Source code:** :source:`Lib/shutil.py`"
msgstr "**源代码:** :source:`Lib/shutil.py`"
#: ../../library/shutil.rst:18
msgid ""
"The :mod:`shutil` module offers a number of high-level operations on files "
"and collections of files. In particular, functions are provided which "
"support file copying and removal. For operations on individual files, see "
"also the :mod:`os` module."
msgstr ""
":mod:`shutil` 模块提供了一系列对文件和文件集合的高阶操作。 特别是提供了一些支持文件拷贝和删除的函数。 对于单个文件的操作,请参阅 "
":mod:`os` 模块。"
#: ../../library/shutil.rst:25
msgid ""
"Even the higher-level file copying functions (:func:`shutil.copy`, "
":func:`shutil.copy2`) cannot copy all file metadata."
msgstr ""
"即便是高阶文件拷贝函数 (:func:`shutil.copy`, :func:`shutil.copy2`) 也无法拷贝所有的文件元数据。"
#: ../../library/shutil.rst:28
msgid ""
"On POSIX platforms, this means that file owner and group are lost as well as"
" ACLs. On Mac OS, the resource fork and other metadata are not used. This "
"means that resources will be lost and file type and creator codes will not "
"be correct. On Windows, file owners, ACLs and alternate data streams are not"
" copied."
msgstr ""
"在 POSIX 平台上,这意味着将丢失文件所有者和组以及 ACL 数据。 在 Mac OS 上,资源钩子和其他元数据不被使用。 "
"这意味着将丢失这些资源并且文件类型和创建者代码将不正确。 在 Windows 上,将不会拷贝文件所有者、ACL 和替代数据流。"
#: ../../library/shutil.rst:38
msgid "Directory and files operations"
msgstr "目录和文件操作"
#: ../../library/shutil.rst:42
msgid ""
"Copy the contents of the file-like object *fsrc* to the file-like object "
"*fdst*. The integer *length*, if given, is the buffer size. In particular, a"
" negative *length* value means to copy the data without looping over the "
"source data in chunks; by default the data is read in chunks to avoid "
"uncontrolled memory consumption. Note that if the current file position of "
"the *fsrc* object is not 0, only the contents from the current file position"
" to the end of the file will be copied."
msgstr ""
"将文件型对象 *fsrc* 的内容拷贝到文件型对象 *fdst*。 整数值 *length* 如果给出则为缓冲区大小。 特别地, *length* "
"为负值表示拷贝数据时不对源数据进行分块循环处理;默认情况下会分块读取数据以避免不受控制的内存消耗。 请注意如果 *fsrc* 对象的当前文件位置不为 "
"0,则只有从当前文件位置到文件末尾的内容会被拷贝。"
#: ../../library/shutil.rst:53
msgid ""
"Copy the contents (no metadata) of the file named *src* to a file named "
"*dst* and return *dst* in the most efficient way possible. *src* and *dst* "
"are path-like objects or path names given as strings."
msgstr ""
"将名为 *src* 的文件的内容(不包括元数据)拷贝到名为 *dst* 的文件并以尽可能高效的方式返回 *dst*。 *src* 和 *dst* "
"均为路径类对象或以字符串形式给出的路径名。"
#: ../../library/shutil.rst:57
msgid ""
"*dst* must be the complete target file name; look at :func:`~shutil.copy` "
"for a copy that accepts a target directory path. If *src* and *dst* specify"
" the same file, :exc:`SameFileError` is raised."
msgstr ""
"*dst* 必须是完整的目标文件名;对于接受目标目录路径的拷贝请参见 :func:`~shutil.copy`。 如果 *src* 和 *dst* "
"指定了同一个文件,则将引发 :exc:`SameFileError`。"
#: ../../library/shutil.rst:61
msgid ""
"The destination location must be writable; otherwise, an :exc:`OSError` "
"exception will be raised. If *dst* already exists, it will be replaced. "
"Special files such as character or block devices and pipes cannot be copied "
"with this function."
msgstr ""
"目标位置必须是可写的;否则将引发 :exc:`OSError` 异常。 如果 *dst* 已经存在,它将被替换。 "
"特殊文件如字符或块设备以及管道无法用此函数来拷贝。"
#: ../../library/shutil.rst:66
msgid ""
"If *follow_symlinks* is false and *src* is a symbolic link, a new symbolic "
"link will be created instead of copying the file *src* points to."
msgstr "如果 *follow_symlinks* 为假值且 *src* 为符号链接,则将创建一个新的符号链接而不是拷贝 *src* 所指向的文件。"
#: ../../library/shutil.rst:71 ../../library/shutil.rst:177
#: ../../library/shutil.rst:208
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.copyfile`` with "
"arguments ``src``, ``dst``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.copyfile`` 并附带参数 ``src``, ``dst``。"
#: ../../library/shutil.rst:72
msgid ""
":exc:`IOError` used to be raised instead of :exc:`OSError`. Added "
"*follow_symlinks* argument. Now returns *dst*."
msgstr ""
"曾经是引发 :exc:`IOError` 而不是 :exc:`OSError`。 增加了 *follow_symlinks* 参数。 现在是返回 "
"*dst*。"
#: ../../library/shutil.rst:77
msgid ""
"Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is a "
"subclass of the latter, this change is backward compatible."
msgstr "引发 :exc:`SameFileError` 而不是 :exc:`Error`。 由于前者是后者的子类,此改变是向后兼容的。"
#: ../../library/shutil.rst:81 ../../library/shutil.rst:184
#: ../../library/shutil.rst:216 ../../library/shutil.rst:281
#: ../../library/shutil.rst:369
msgid ""
"Platform-specific fast-copy syscalls may be used internally in order to copy"
" the file more efficiently. See :ref:`shutil-platform-dependent-efficient-"
"copy-operations` section."
msgstr ""
"可能会在内部使用平台专属的快速拷贝系统调用以更高效地拷贝文件。 参见 :ref:`shutil-platform-dependent-"
"efficient-copy-operations` 一节。"
#: ../../library/shutil.rst:88
msgid ""
"This exception is raised if source and destination in :func:`copyfile` are "
"the same file."
msgstr "此异常会在 :func:`copyfile` 中的源和目标为同一文件时被引发。"
#: ../../library/shutil.rst:96
msgid ""
"Copy the permission bits from *src* to *dst*. The file contents, owner, and"
" group are unaffected. *src* and *dst* are path-like objects or path names "
"given as strings. If *follow_symlinks* is false, and both *src* and *dst* "
"are symbolic links, :func:`copymode` will attempt to modify the mode of "
"*dst* itself (rather than the file it points to). This functionality is not"
" available on every platform; please see :func:`copystat` for more "
"information. If :func:`copymode` cannot modify symbolic links on the local "
"platform, and it is asked to do so, it will do nothing and return."
msgstr ""
"从 *src* 拷贝权限位到 *dst*。 文件的内容、所有者和分组将不受影响。 *src* 和 *dst* 均为路径类对象或字符串形式的路径名。 如果"
" *follow_symlinks* 为假值,并且 *src* 和 *dst* 均为符号链接,:func:`copymode` 将尝试修改 *dst* "
"本身的模式(而非它所指向的文件)。 此功能并不是在所有平台上均可用;请参阅 :func:`copystat` 了解详情。 如果 "
":func:`copymode` 无法修改本机平台上的符号链接,而它被要求这样做,它将不做任何操作即返回。"
#: ../../library/shutil.rst:107 ../../library/shutil.rst:179
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.copymode`` with "
"arguments ``src``, ``dst``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.copymode`` 并附带参数 ``src``, ``dst``。"
#: ../../library/shutil.rst:108
msgid "Added *follow_symlinks* argument."
msgstr "加入 *follow_symlinks* 参数。"
#: ../../library/shutil.rst:113
msgid ""
"Copy the permission bits, last access time, last modification time, and "
"flags from *src* to *dst*. On Linux, :func:`copystat` also copies the "
"\"extended attributes\" where possible. The file contents, owner, and group"
" are unaffected. *src* and *dst* are path-like objects or path names given "
"as strings."
msgstr ""
"从 *src* 拷贝权限位、最近访问时间、最近修改时间以及旗标到 *dst*。 在 Linux上,:func:`copystat` "
"还会在可能的情况下拷贝“扩展属性”。 文件的内容、所有者和分组将不受影响。 *src* 和 *dst* 均为路径类对象或字符串形式的路径名。"
#: ../../library/shutil.rst:119
msgid ""
"If *follow_symlinks* is false, and *src* and *dst* both refer to symbolic "
"links, :func:`copystat` will operate on the symbolic links themselves rather"
" than the files the symbolic links refer to—reading the information from the"
" *src* symbolic link, and writing the information to the *dst* symbolic "
"link."
msgstr ""
"如果 *follow_symlinks* 为假值,并且 *src* 和 *dst* 均指向符号链接,:func:`copystat` "
"将作用于符号链接本身而非该符号链接所指向的文件 — 从 *src* 符号链接读取信息,并将信息写入 *dst* 符号链接。"
#: ../../library/shutil.rst:128
msgid ""
"Not all platforms provide the ability to examine and modify symbolic links."
" Python itself can tell you what functionality is locally available."
msgstr "并非所有平台者提供检查和修改符号链接的功能。 Python 本身可以告诉你哪些功能是在本机上可用的。"
#: ../../library/shutil.rst:132
msgid ""
"If ``os.chmod in os.supports_follow_symlinks`` is ``True``, :func:`copystat`"
" can modify the permission bits of a symbolic link."
msgstr ""
"如果 ``os.chmod in os.supports_follow_symlinks`` 为 ``True``,则 :func:`copystat`"
" 可以修改符号链接的权限位。"
#: ../../library/shutil.rst:136
msgid ""
"If ``os.utime in os.supports_follow_symlinks`` is ``True``, :func:`copystat`"
" can modify the last access and modification times of a symbolic link."
msgstr ""
"如果 ``os.utime in os.supports_follow_symlinks`` 为 ``True``,则 :func:`copystat`"
" 可以修改符号链接的最近访问和修改时间。"
#: ../../library/shutil.rst:140
msgid ""
"If ``os.chflags in os.supports_follow_symlinks`` is ``True``, "
":func:`copystat` can modify the flags of a symbolic link. (``os.chflags`` "
"is not available on all platforms.)"
msgstr ""
"如果 ``os.chflags in os.supports_follow_symlinks`` 为 ``True``,则 "
":func:`copystat` 可以修改符号链接的旗标。 (``os.chflags`` 不是在所有平台上均可用。)"
#: ../../library/shutil.rst:145
msgid ""
"On platforms where some or all of this functionality is unavailable, when "
"asked to modify a symbolic link, :func:`copystat` will copy everything it "
"can. :func:`copystat` never returns failure."
msgstr ""
"在此功能部分或全部不可用的平台上,当被要求修改一个符号链接时,:func:`copystat` 将尽量拷贝所有内容。 :func:`copystat` "
"一定不会返回失败信息。"
#: ../../library/shutil.rst:150
msgid "Please see :data:`os.supports_follow_symlinks` for more information."
msgstr "更多信息请参阅 :data:`os.supports_follow_symlinks`。"
#: ../../library/shutil.rst:154 ../../library/shutil.rst:210
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.copystat`` with "
"arguments ``src``, ``dst``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.copystat`` 并附带参数 ``src``, ``dst``。"
#: ../../library/shutil.rst:155
msgid ""
"Added *follow_symlinks* argument and support for Linux extended attributes."
msgstr "添加了 *follow_symlinks* 参数并且支持 Linux 扩展属性。"
#: ../../library/shutil.rst:160
msgid ""
"Copies the file *src* to the file or directory *dst*. *src* and *dst* "
"should be :term:`path-like objects <path-like object>` or strings. If *dst*"
" specifies a directory, the file will be copied into *dst* using the base "
"filename from *src*. Returns the path to the newly created file."
msgstr ""
"将文件 *src* 拷贝到文件或目录 *dst*。 *src* 和 *dst* 应为 :term:`路径类对象 <path-like object>` "
"或字符串。 如果 *dst* 指定了一个目录,文件将使用 *src* 中的基准文件名拷贝到 *dst* 中。 将返回新创建文件所对应的路径。"
#: ../../library/shutil.rst:165
msgid ""
"If *follow_symlinks* is false, and *src* is a symbolic link, *dst* will be "
"created as a symbolic link. If *follow_symlinks* is true and *src* is a "
"symbolic link, *dst* will be a copy of the file *src* refers to."
msgstr ""
"如果 *follow_symlinks* 为假值且 *src* 为符号链接,则 *dst* 也将被创建为符号链接。 如果 "
"*follow_symlinks* 为真值且 *src* 为符号链接,*dst* 将成为 *src* 所指向的文件的一个副本。"
#: ../../library/shutil.rst:170
msgid ""
":func:`~shutil.copy` copies the file data and the file's permission mode "
"(see :func:`os.chmod`). Other metadata, like the file's creation and "
"modification times, is not preserved. To preserve all file metadata from the"
" original, use :func:`~shutil.copy2` instead."
msgstr ""
":func:`~shutil.copy` 会拷贝文件数据和文件的权限模式 (参见 :func:`os.chmod`)。 "
"其他元数据,例如文件的创建和修改时间不会被保留。 要保留所有原有的元数据,请改用 :func:`~shutil.copy2` 。"
#: ../../library/shutil.rst:180
msgid ""
"Added *follow_symlinks* argument. Now returns path to the newly created "
"file."
msgstr "添加了 *follow_symlinks* 参数。 现在会返回新创建文件的路径。"
#: ../../library/shutil.rst:191
msgid ""
"Identical to :func:`~shutil.copy` except that :func:`copy2` also attempts to"
" preserve file metadata."
msgstr "类似于 :func:`~shutil.copy`,区别在于 :func:`copy2` 还会尝试保留文件的元数据。"
#: ../../library/shutil.rst:194
msgid ""
"When *follow_symlinks* is false, and *src* is a symbolic link, :func:`copy2`"
" attempts to copy all metadata from the *src* symbolic link to the newly-"
"created *dst* symbolic link. However, this functionality is not available on"
" all platforms. On platforms where some or all of this functionality is "
"unavailable, :func:`copy2` will preserve all the metadata it can; "
":func:`copy2` never raises an exception because it cannot preserve file "
"metadata."
msgstr ""
"当 *follow_symlinks* 为假值且 *src* 为符号链接时,:func:`copy2` 会尝试将来自 *src* "
"符号链接的所有元数据拷贝到新创建的 *dst* 符号链接。 但是,此功能不是在所有平台上均可用。 "
"在此功能部分或全部不可用的平台上,:func:`copy2` 将尽量保留所有元数据;:func:`copy2` "
"一定不会由于无法保留文件元数据而引发异常。"
#: ../../library/shutil.rst:203
msgid ""
":func:`copy2` uses :func:`copystat` to copy the file metadata. Please see "
":func:`copystat` for more information about platform support for modifying "
"symbolic link metadata."
msgstr ""
":func:`copy2` 会使用 :func:`copystat` 来拷贝文件元数据。 请参阅 :func:`copystat` "
"了解有关修改符号链接元数据的平台支持的更多信息。"
#: ../../library/shutil.rst:211
msgid ""
"Added *follow_symlinks* argument, try to copy extended file system "
"attributes too (currently Linux only). Now returns path to the newly created"
" file."
msgstr "添加了 *follow_symlinks* 参数,还会尝试拷贝扩展文件系统属性(目前仅限 Linux)。 现在会返回新创建文件的路径。"
#: ../../library/shutil.rst:223
msgid ""
"This factory function creates a function that can be used as a callable for "
":func:`copytree`\\'s *ignore* argument, ignoring files and directories that "
"match one of the glob-style *patterns* provided. See the example below."
msgstr ""
"这个工厂函数会创建一个函数,它可被用作 :func:`copytree` 的 *ignore* 可调用对象参数,以忽略那些匹配所提供的 glob 风格的"
" *patterns* 之一的文件和目录。 参见以下示例。"
#: ../../library/shutil.rst:232
msgid ""
"Recursively copy an entire directory tree rooted at *src* to a directory "
"named *dst* and return the destination directory. *dirs_exist_ok* dictates "
"whether to raise an exception in case *dst* or any missing parent directory "
"already exists."
msgstr ""
"将以 *src* 为根起点的整个目录树拷贝到名为 *dst* 的目录并返回目标目录。 *dirs_exist_ok* 指明是否要在 *dst* "
"或任何丢失的父目录已存在的情况下引发异常。"
#: ../../library/shutil.rst:237
msgid ""
"Permissions and times of directories are copied with :func:`copystat`, "
"individual files are copied using :func:`~shutil.copy2`."
msgstr "目录的权限和时间会通过 :func:`copystat` 来拷贝,单个文件则会使用 :func:`~shutil.copy2` 来拷贝。"
#: ../../library/shutil.rst:240
msgid ""
"If *symlinks* is true, symbolic links in the source tree are represented as "
"symbolic links in the new tree and the metadata of the original links will "
"be copied as far as the platform allows; if false or omitted, the contents "
"and metadata of the linked files are copied to the new tree."
msgstr ""
"如果 *symlinks* "
"为真值,源目录树中的符号链接会在新目录树中表示为符号链接,并且原链接的元数据在平台允许的情况下也会被拷贝;如果为假值或省略,则会将被链接文件的内容和元数据拷贝到新目录树。"
#: ../../library/shutil.rst:245
msgid ""
"When *symlinks* is false, if the file pointed by the symlink doesn't exist, "
"an exception will be added in the list of errors raised in an :exc:`Error` "
"exception at the end of the copy process. You can set the optional "
"*ignore_dangling_symlinks* flag to true if you want to silence this "
"exception. Notice that this option has no effect on platforms that don't "
"support :func:`os.symlink`."
msgstr ""
"当 *symlinks* 为假值时,如果符号链接所指向的文件不存在,则会在拷贝进程的末尾将一个异常添加到 :exc:`Error` 异常中的错误列表。 "
"如果你希望屏蔽此异常那就将可选的 *ignore_dangling_symlinks* 旗标设为真值。 请注意此选项在不支持 "
":func:`os.symlink` 的平台上将不起作用。"
#: ../../library/shutil.rst:252
msgid ""
"If *ignore* is given, it must be a callable that will receive as its "
"arguments the directory being visited by :func:`copytree`, and a list of its"
" contents, as returned by :func:`os.listdir`. Since :func:`copytree` is "
"called recursively, the *ignore* callable will be called once for each "
"directory that is copied. The callable must return a sequence of directory "
"and file names relative to the current directory (i.e. a subset of the items"
" in its second argument); these names will then be ignored in the copy "
"process. :func:`ignore_patterns` can be used to create such a callable that"
" ignores names based on glob-style patterns."
msgstr ""
"如果给出了 *ignore*,它必须是一个可调用对象,该对象将接受 :func:`copytree` 所访问的目录以及 "
":func:`os.listdir` 所返回的目录内容列表作为其参数。 由于 :func:`copytree` 是递归地被调用的,*ignore* "
"可调用对象对于每个被拷贝目录都将被调用一次。 "
"该可调用对象必须返回一个相对于当前目录的目录和文件名序列(即其第二个参数的子集);随后这些名称将在拷贝进程中被忽略。 "
":func:`ignore_patterns` 可被用于创建这种基于 glob 风格模式来忽略特定名称的可调用对象。"
#: ../../library/shutil.rst:262
msgid ""
"If exception(s) occur, an :exc:`Error` is raised with a list of reasons."
msgstr "如果发生了(一个或多个)异常,将引发一个附带原因列表的 :exc:`Error`。"
#: ../../library/shutil.rst:264
msgid ""
"If *copy_function* is given, it must be a callable that will be used to copy"
" each file. It will be called with the source path and the destination path "
"as arguments. By default, :func:`~shutil.copy2` is used, but any function "
"that supports the same signature (like :func:`~shutil.copy`) can be used."
msgstr ""
"如果给出了 *copy_function*,它必须是一个将被用来拷贝每个文件的可调用对象。 它在被调用时会将源路径和目标路径作为参数传入。 "
"默认情况下,:func:`~shutil.copy2` 将被使用,但任何支持同样签名(与 :func:`~shutil.copy` 一致)都可以使用。"
#: ../../library/shutil.rst:270
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.copytree`` with "
"arguments ``src``, ``dst``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.copytree`` 并附带参数 ``src``, ``dst``。"
#: ../../library/shutil.rst:271
msgid "Copy metadata when *symlinks* is false. Now returns *dst*."
msgstr "当 *symlinks* 为假值时拷贝元数据。 现在会返回 *dst*。"
#: ../../library/shutil.rst:275
msgid ""
"Added the *copy_function* argument to be able to provide a custom copy "
"function. Added the *ignore_dangling_symlinks* argument to silent dangling "
"symlinks errors when *symlinks* is false."
msgstr ""
"添加了 *copy_function* 参数以允许提供定制的拷贝函数。 添加了 *ignore_dangling_symlinks* 参数以便在 "
"*symlinks* 为假值时屏蔽符号链接错误。"
#: ../../library/shutil.rst:286
msgid "The *dirs_exist_ok* parameter."
msgstr "*dirs_exist_ok* 形参。"
#: ../../library/shutil.rst:293
msgid ""
"Delete an entire directory tree; *path* must point to a directory (but not a"
" symbolic link to a directory). If *ignore_errors* is true, errors "
"resulting from failed removals will be ignored; if false or omitted, such "
"errors are handled by calling a handler specified by *onerror* or, if that "
"is omitted, they raise an exception."
msgstr ""
"删除一个完整的目录树;*path* 必须指向一个目录(但不能是一个目录的符号链接)。 如果 *ignore_errors* "
"为真值,删除失败导致的错误将被忽略;如果为假值或是省略,此类错误将通过调用由 *onerror* "
"所指定的处理程序来处理,或者如果此参数被省略则将引发一个异常。"
#: ../../library/shutil.rst:301
msgid ""
"On platforms that support the necessary fd-based functions a symlink attack "
"resistant version of :func:`rmtree` is used by default. On other platforms,"
" the :func:`rmtree` implementation is susceptible to a symlink attack: given"
" proper timing and circumstances, attackers can manipulate symlinks on the "
"filesystem to delete files they wouldn't be able to access otherwise. "
"Applications can use the :data:`rmtree.avoids_symlink_attacks` function "
"attribute to determine which case applies."
msgstr ""
"在支持必要的基于 fd 的函数的平台上,默认会使用 :func:`rmtree` 的可防御符号链接攻击的版本。 "
"在其他平台上,:func:`rmtree` "
"较易遭受符号链接攻击:给定适当的时间和环境,攻击者可以操纵文件系统中的符号链接来删除他们在其他情况下无法访问的文件。 应用程序可以使用 "
":data:`rmtree.avoids_symlink_attacks` 函数属性来确定此类情况具体是哪一些。"
#: ../../library/shutil.rst:309
msgid ""
"If *onerror* is provided, it must be a callable that accepts three "
"parameters: *function*, *path*, and *excinfo*."
msgstr "如果提供了 *onerror*,它必须为接受三个形参的可调用对象: *function*, *path* 和 *excinfo*。"
#: ../../library/shutil.rst:312
msgid ""
"The first parameter, *function*, is the function which raised the exception;"
" it depends on the platform and implementation. The second parameter, "
"*path*, will be the path name passed to *function*. The third parameter, "
"*excinfo*, will be the exception information returned by "
":func:`sys.exc_info`. Exceptions raised by *onerror* will not be caught."
msgstr ""
"第一个形参 *function* 是引发异常的函数;它依赖于具体的平台和实现。 第二个形参 *path* 将是传递给 *function* 的路径名。 "
"第三个形参 *excinfo* 将是由 :func:`sys.exc_info` 所返回的异常信息。 由 *onerror* 所引发的异常将不会被捕获。"
#: ../../library/shutil.rst:319
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.rmtree`` with argument "
"``path``."
msgstr "引发一个 :ref:`审计事件 <auditing>` ``shutil.rmtree`` 附带参数 ``path``。"
#: ../../library/shutil.rst:320
msgid ""
"Added a symlink attack resistant version that is used automatically if "
"platform supports fd-based functions."
msgstr "添加了一个防御符号链接攻击的版本,如果平台支持基于 fd 的函数就会被使用。"
#: ../../library/shutil.rst:324
msgid ""
"On Windows, will no longer delete the contents of a directory junction "
"before removing the junction."
msgstr "在 Windows 上将不会再在移除连接之前删除目录连接中的内容。"
#: ../../library/shutil.rst:330
msgid ""
"Indicates whether the current platform and implementation provides a symlink"
" attack resistant version of :func:`rmtree`. Currently this is only true "
"for platforms supporting fd-based directory access functions."
msgstr ""
"指明当前平台和实现是否提供防御符号链接攻击的 :func:`rmtree` 版本。 目前它仅在平台支持基于 fd 的目录访问函数时才返回真值。"
#: ../../library/shutil.rst:339
msgid ""
"Recursively move a file or directory (*src*) to another location (*dst*) and"
" return the destination."
msgstr "递归地将一个文件或目录 (*src*) 移至另一位置 (*dst*) 并返回目标位置。"
#: ../../library/shutil.rst:342
msgid ""
"If the destination is an existing directory, then *src* is moved inside that"
" directory. If the destination already exists but is not a directory, it may"
" be overwritten depending on :func:`os.rename` semantics."
msgstr ""
"如果目标是已存在的目录,则 *src* 会被移至该目录下。 如果目标已存在但不是目录,它可能会被覆盖,具体取决于 :func:`os.rename` "
"的语义。"
#: ../../library/shutil.rst:346
msgid ""
"If the destination is on the current filesystem, then :func:`os.rename` is "
"used. Otherwise, *src* is copied to *dst* using *copy_function* and then "
"removed. In case of symlinks, a new symlink pointing to the target of *src*"
" will be created in or as *dst* and *src* will be removed."
msgstr ""
"如果目标是在当前文件系统中,则会使用 :func:`os.rename`。 在其他情况下,*src* 将被拷贝至 *dst*,使用的函数为 "
"*copy_function*,然后目标会被移除。 对于符号链接,则将在 *dst* 之下或以其本身为名称创建一个指向 *src* "
"目标的新符号链接,并且 *src* 将被移除。"
#: ../../library/shutil.rst:351
msgid ""
"If *copy_function* is given, it must be a callable that takes two arguments "
"*src* and *dst*, and will be used to copy *src* to *dst* if "
":func:`os.rename` cannot be used. If the source is a directory, "
":func:`copytree` is called, passing it the :func:`copy_function`. The "
"default *copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the"
" *copy_function* allows the move to succeed when it is not possible to also "
"copy the metadata, at the expense of not copying any of the metadata."
msgstr ""
"如果给出了 *copy_function*,则它必须为接受两个参数 *src* 和 *dst* 的可调用对象,并将在 :func:`os.rename`"
" 无法使用时被用来将 *src* 拷贝到 *dst*。 如果源是一个目录,则会调用 :func:`copytree`,并向它传入 "
":func:`copy_function`。 默认的 *copy_function* 是 :func:`copy2`。 使用 "
":func:`~shutil.copy` 作为 *copy_function* "
"允许在无法附带拷贝元数据时让移动操作成功执行,但其代价是不拷贝任何元数据。"
#: ../../library/shutil.rst:360
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.move`` with arguments "
"``src``, ``dst``."
msgstr "引发一个 :ref:`审计事件 <auditing>` ``shutil.move`` 并附带参数 ``src``, ``dst``。"
#: ../../library/shutil.rst:361
msgid ""
"Added explicit symlink handling for foreign filesystems, thus adapting it to"
" the behavior of GNU's :program:`mv`. Now returns *dst*."
msgstr "为异类文件系统添加了显式的符号链接处理,以便使它适应 GNU 的 :program:`mv` 的行为。 现在会返回 *dst*。"
#: ../../library/shutil.rst:366
msgid "Added the *copy_function* keyword argument."
msgstr "增加了 *copy_function* 关键字参数。"
#: ../../library/shutil.rst:376
msgid ""
"Return disk usage statistics about the given path as a :term:`named tuple` "
"with the attributes *total*, *used* and *free*, which are the amount of "
"total, used and free space, in bytes. *path* may be a file or a directory."
msgstr ""
"返回给定路径的磁盘使用统计数据,形式为一个 :term:`named tuple`,其中包含 *total*, *used* 和 *free* "
"属性,分别表示总计、已使用和未使用空间的字节数。 *path* 可以是一个文件或是一个目录。"
#: ../../library/shutil.rst:383
msgid "On Windows, *path* can now be a file or directory."
msgstr "在 Windows 上,*path* 现在可以是一个文件或目录。"
#: ../../library/shutil.rst:386
msgid ":ref:`Availability <availability>`: Unix, Windows."
msgstr ":ref:`可用性 <availability>`: Unix, Windows。"
#: ../../library/shutil.rst:390
msgid "Change owner *user* and/or *group* of the given *path*."
msgstr "修改给定 *path* 的所有者 *user* 和/或 *group*。"
#: ../../library/shutil.rst:392
msgid ""
"*user* can be a system user name or a uid; the same applies to *group*. At "
"least one argument is required."
msgstr "*user* 可以是一个系统用户名或 uid;*group* 同样如此。 要求至少有一个参数。"
#: ../../library/shutil.rst:395
msgid "See also :func:`os.chown`, the underlying function."
msgstr "另请参阅下层的函数 :func:`os.chown`。"
#: ../../library/shutil.rst:398
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.chown`` with arguments "
"``path``, ``user``, ``group``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.chown`` 并附带参数 ``path``, ``user``, "
"``group``。"
#: ../../library/shutil.rst:400
msgid ":ref:`Availability <availability>`: Unix."
msgstr ":ref:`可用性 <availability>`: Unix。"
#: ../../library/shutil.rst:406
msgid ""
"Return the path to an executable which would be run if the given *cmd* was "
"called. If no *cmd* would be called, return ``None``."
msgstr "返回当给定的 *cmd* 被调用时将要运行的可执行文件的路径。 如果没有 *cmd* 会被调用则返回 ``None``。"
#: ../../library/shutil.rst:409
msgid ""
"*mode* is a permission mask passed to :func:`os.access`, by default "
"determining if the file exists and executable."
msgstr "*mode* 是一个传递给 :func:`os.access` 的权限掩码,在默认情况下将确定文件是否存在并且为可执行文件。"
#: ../../library/shutil.rst:412
msgid ""
"When no *path* is specified, the results of :func:`os.environ` are used, "
"returning either the \"PATH\" value or a fallback of :attr:`os.defpath`."
msgstr ""
"当未指定 *path* 时,将会使用 :func:`os.environ` 的结果,返回 \"PATH\" 的值或回退为 "
":attr:`os.defpath`。"
#: ../../library/shutil.rst:415
msgid ""
"On Windows, the current directory is always prepended to the *path* whether "
"or not you use the default or provide your own, which is the behavior the "
"command shell uses when finding executables. Additionally, when finding the"
" *cmd* in the *path*, the ``PATHEXT`` environment variable is checked. For "
"example, if you call ``shutil.which(\"python\")``, :func:`which` will search"
" ``PATHEXT`` to know that it should look for ``python.exe`` within the "
"*path* directories. For example, on Windows::"
msgstr ""
"在 Windows 上当前目录总是会被添加为 *path* "
"的第一项,无论你是否使用默认值或提供你自己的路径,这是命令行终端在查找可执行文件时所采用的行为方式。 此外,当在 *path* 中查找 *cmd* "
"时,还会检查 ``PATHEXT`` 环境变量。 例如,如果你调用 ``shutil.which(\"python\")``,:func:`which`"
" 将搜索 ``PATHEXT`` 来确定它要在 *path* 目录中查找 ``python.exe``。 例如,在 Windows 上::"
#: ../../library/shutil.rst:428
msgid ""
"The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, "
"the result type is also :class:`bytes`."
msgstr ""
"现在可以接受 :class:`bytes` 类型。 如果 *cmd* 的类型为 :class:`bytes`,结果的类型也将为 "
":class:`bytes`。"
#: ../../library/shutil.rst:434
msgid ""
"This exception collects exceptions that are raised during a multi-file "
"operation. For :func:`copytree`, the exception argument is a list of "
"3-tuples (*srcname*, *dstname*, *exception*)."
msgstr ""
"此异常会收集在多文件操作期间所引发的异常。 对于 :func:`copytree`,此异常参数将是一个由三元组 (*srcname*, "
"*dstname*, *exception*) 构成的列表。"
#: ../../library/shutil.rst:441
msgid "Platform-dependent efficient copy operations"
msgstr "依赖于具体平台的高效拷贝操作"
#: ../../library/shutil.rst:443
msgid ""
"Starting from Python 3.8, all functions involving a file copy "
"(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, "
"and :func:`move`) may use platform-specific \"fast-copy\" syscalls in order "
"to copy the file more efficiently (see :issue:`33671`). \"fast-copy\" means "
"that the copying operation occurs within the kernel, avoiding the use of "
"userspace buffers in Python as in \"``outfd.write(infd.read())``\"."
msgstr ""
"从 Python 3.8 开始,所有涉及文件拷贝的函数 (:func:`copyfile`, :func:`~shutil.copy`, "
":func:`copy2`, :func:`copytree` 以及 :func:`move`) 将会使用平台专属的 \"fast-copy\" "
"系统调用以便更高效地拷贝文件 (参见 :issue:`33671`)。 \"fast-copy\" 意味着拷贝操作将发生于内核之中,避免像在 "
"\"``outfd.write(infd.read())``\" 中那样使用 Python 用户空间的缓冲区。"
#: ../../library/shutil.rst:451
msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)."
msgstr "在 macOS 上将会使用 `fcopyfile`_ 来拷贝文件内容(不含元数据)。"
#: ../../library/shutil.rst:453
msgid "On Linux :func:`os.sendfile` is used."
msgstr "在 Linux 上将会使用 :func:`os.sendfile`。"
#: ../../library/shutil.rst:455
msgid ""
"On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB "
"instead of 64 KiB) and a :func:`memoryview`-based variant of "
":func:`shutil.copyfileobj` is used."
msgstr ""
"在 Windows 上 :func:`shutil.copyfile` 将会使用更大的默认缓冲区(1 MiB 而非 64 KiB)并且会使用基于 "
":func:`memoryview` 的 :func:`shutil.copyfileobj` 变种形式。"
#: ../../library/shutil.rst:459
msgid ""
"If the fast-copy operation fails and no data was written in the destination "
"file then shutil will silently fallback on using less efficient "
":func:`copyfileobj` function internally."
msgstr ""
"如果快速拷贝操作失败并且没有数据被写入目标文件,则 shutil 将在内部静默地回退到使用效率较低的 :func:`copyfileobj` 函数。"
#: ../../library/shutil.rst:468
msgid "copytree example"
msgstr "copytree 示例"
#: ../../library/shutil.rst:470
msgid ""
"This example is the implementation of the :func:`copytree` function, "
"described above, with the docstring omitted. It demonstrates many of the "
"other functions provided by this module. ::"
msgstr ""
"这个示例就是上面所描述的 :func:`copytree` 函数的实现,其中省略了文档字符串。 它还展示了此模块所提供的许多其他函数。 ::"
#: ../../library/shutil.rst:505
msgid "Another example that uses the :func:`ignore_patterns` helper::"
msgstr "另一个使用 :func:`ignore_patterns` 辅助函数的例子::"
#: ../../library/shutil.rst:511
msgid ""
"This will copy everything except ``.pyc`` files and files or directories "
"whose name starts with ``tmp``."
msgstr "这将会拷贝除 ``.pyc`` 文件和以 ``tmp`` 打头的文件或目录以外的所有条目."
#: ../../library/shutil.rst:514
msgid ""
"Another example that uses the *ignore* argument to add a logging call::"
msgstr "另一个使用 *ignore* 参数来添加记录调用的例子::"
#: ../../library/shutil.rst:529
msgid "rmtree example"
msgstr "rmtree 示例"
#: ../../library/shutil.rst:531
msgid ""
"This example shows how to remove a directory tree on Windows where some of "
"the files have their read-only bit set. It uses the onerror callback to "
"clear the readonly bit and reattempt the remove. Any subsequent failure will"
" propagate. ::"
msgstr ""
"这个例子演示了如何在 Windows 上删除一个目录树,其中部分文件设置了只读属性位。 它会使用 onerror "
"回调函数来清除只读属性位并再次尝试删除。 任何后续的失败都将被传播。 ::"
#: ../../library/shutil.rst:549
msgid "Archiving operations"
msgstr "归档操作"
#: ../../library/shutil.rst:553
msgid "Added support for the *xztar* format."
msgstr "添加了对 *xztar* 格式的支持。"
#: ../../library/shutil.rst:557
msgid ""
"High-level utilities to create and read compressed and archived files are "
"also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules."
msgstr ""
"本模块也提供了用于创建和读取压缩和归档文件的高层级工具。 它们依赖于 :mod:`zipfile` 和 :mod:`tarfile` 模块。"
#: ../../library/shutil.rst:562
msgid "Create an archive file (such as zip or tar) and return its name."
msgstr "创建一个归档文件(例如 zip 或 tar)并返回其名称。"
#: ../../library/shutil.rst:564
msgid ""
"*base_name* is the name of the file to create, including the path, minus any"
" format-specific extension. *format* is the archive format: one of \"zip\" "
"(if the :mod:`zlib` module is available), \"tar\", \"gztar\" (if the "
":mod:`zlib` module is available), \"bztar\" (if the :mod:`bz2` module is "
"available), or \"xztar\" (if the :mod:`lzma` module is available)."
msgstr ""
"*base_name* 是要创建的文件名称,包括路径,去除任何特定格式的扩展名。 *format* 是归档格式:为 \"zip\" (如果 "
":mod:`zlib` 模块可用), \"tar\", \"gztar\" (如果 :mod:`zlib` 模块可用), \"bztar\" (如果 "
":mod:`bz2` 模块可用) 或 \"xztar\" (如果 :mod:`lzma` 模块可用) 中的一个。"
#: ../../library/shutil.rst:570
msgid ""
"*root_dir* is a directory that will be the root directory of the archive, "
"all paths in the archive will be relative to it; for example, we typically "
"chdir into *root_dir* before creating the archive."
msgstr ""
"*root_dir* 是一个目录,它将作为归档文件的根目录,归档中的所有路径都将是它的相对路径;例如,我们通常会在创建归档之前用 chdir 命令切换到"
" *root_dir*。"
#: ../../library/shutil.rst:574
msgid ""
"*base_dir* is the directory where we start archiving from; i.e. *base_dir* "
"will be the common prefix of all files and directories in the archive. "
"*base_dir* must be given relative to *root_dir*. See :ref:`shutil-"
"archiving-example-with-basedir` for how to use *base_dir* and *root_dir* "
"together."
msgstr ""
"*base_dir* 是我们要执行归档的起始目录;也就是说 *base_dir* 将成为归档中所有文件和目录共有的路径前缀。 *base_dir* "
"必须相对于 *root_dir* 给出。 请参阅 :ref:`shutil-archiving-example-with-basedir` "
"了解如何同时使用 *base_dir* 和 *root_dir*。"
#: ../../library/shutil.rst:580
msgid "*root_dir* and *base_dir* both default to the current directory."
msgstr "*root_dir* 和 *base_dir* 默认均为当前目录。"
#: ../../library/shutil.rst:582
msgid ""
"If *dry_run* is true, no archive is created, but the operations that would "
"be executed are logged to *logger*."
msgstr "如果 *dry_run* 为真值,则不会创建归档文件,但将要被执行的操作会被记录到 *logger*。"
#: ../../library/shutil.rst:585
msgid ""
"*owner* and *group* are used when creating a tar archive. By default, uses "
"the current owner and group."
msgstr "*owner* 和 *group* 将在创建 tar 归档文件时被使用。 默认会使用当前的所有者和分组。"
#: ../../library/shutil.rst:588
msgid ""
"*logger* must be an object compatible with :pep:`282`, usually an instance "
"of :class:`logging.Logger`."
msgstr "*logger* 必须是一个兼容 :pep:`282` 的对象,通常为 :class:`logging.Logger` 的实例。"
#: ../../library/shutil.rst:591
msgid "The *verbose* argument is unused and deprecated."
msgstr "*verbose* 参数已不再使用并进入弃用状态。"
#: ../../library/shutil.rst:594
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.make_archive`` with "
"arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.make_archive`` 并附带参数 ``base_name``, "
"``format``, ``root_dir``, ``base_dir``。"
#: ../../library/shutil.rst:597
msgid "This function is not thread-safe."
msgstr "这个函数不是线程安全的。"
#: ../../library/shutil.rst:599
msgid ""
"The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU "
"format for archives created with ``format=\"tar\"``."
msgstr ""
"现在对于通过 ``format=\"tar\"`` 创建的归档文件将使用新式的 pax (POSIX.1-2001) 格式而非旧式的 GNU 格式。"
#: ../../library/shutil.rst:606
msgid ""
"Return a list of supported formats for archiving. Each element of the "
"returned sequence is a tuple ``(name, description)``."
msgstr "返回支持的归档格式列表。 所返回序列中的每个元素为一个元组 ``(name, description)``。"
#: ../../library/shutil.rst:609 ../../library/shutil.rst:712
msgid "By default :mod:`shutil` provides these formats:"
msgstr "默认情况下 :mod:`shutil` 提供以下格式:"
#: ../../library/shutil.rst:611
msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)."
msgstr "*zip*: ZIP 文件(如果 :mod:`zlib` 模块可用)。"
#: ../../library/shutil.rst:612
msgid ""
"*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives."
msgstr "*tar*: 未压缩的 tar 文件。 对于新归档文件将使用 POSIX.1-2001 pax 格式。"
#: ../../library/shutil.rst:613 ../../library/shutil.rst:717
msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)."
msgstr "*gztar*: gzip 压缩的 tar 文件(如果 :mod:`zlib` 模块可用)。"
#: ../../library/shutil.rst:614 ../../library/shutil.rst:718
msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)."
msgstr "*bztar*: bzip2 压缩的 tar 文件(如果 :mod:`bz2` 模块可用)。"
#: ../../library/shutil.rst:615 ../../library/shutil.rst:719
msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)."
msgstr "*xztar*: xz 压缩的 tar 文件(如果 :mod:`lzma` 模块可用)。"
#: ../../library/shutil.rst:617
msgid ""
"You can register new formats or provide your own archiver for any existing "
"formats, by using :func:`register_archive_format`."
msgstr "你可以通过使用 :func:`register_archive_format` 注册新的格式或为任何现有格式提供你自己的归档器。"
#: ../../library/shutil.rst:623
msgid "Register an archiver for the format *name*."
msgstr "为 *name* 格式注册一个归档器。"
#: ../../library/shutil.rst:625
msgid ""
"*function* is the callable that will be used to unpack archives. The "
"callable will receive the *base_name* of the file to create, followed by the"
" *base_dir* (which defaults to :data:`os.curdir`) to start archiving from. "
"Further arguments are passed as keyword arguments: *owner*, *group*, "
"*dry_run* and *logger* (as passed in :func:`make_archive`)."
msgstr ""
"*function* 是将被用来解包归档文件的可调用对象。 该可调用对象将接收要创建文件的 *base_name*,再加上要归档内容的 "
"*base_dir* (其默认值为 :data:`os.curdir`)。 更多参数会被作为关键字参数传入: *owner*, *group*, "
"*dry_run* 和 *logger* (与向 :func:`make_archive` 传入的参数一致)。"
#: ../../library/shutil.rst:631
msgid ""
"If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be"
" used as extra keywords arguments when the archiver callable is used."
msgstr ""
"如果给出了 *extra_args*,则其应为一个 ``(name, value)`` 对的序列,将在归档器可调用对象被使用时作为附加的关键字参数。"
#: ../../library/shutil.rst:634
msgid ""
"*description* is used by :func:`get_archive_formats` which returns the list "
"of archivers. Defaults to an empty string."
msgstr ""
"*description* 由 :func:`get_archive_formats` 使用,它将返回归档器的列表。 默认值为一个空字符串。"
#: ../../library/shutil.rst:640
msgid "Remove the archive format *name* from the list of supported formats."
msgstr "从支持的格式中移除归档格式 *name*。"
#: ../../library/shutil.rst:645
msgid "Unpack an archive. *filename* is the full path of the archive."
msgstr "解包一个归档文件。 *filename* 是归档文件的完整路径。"
#: ../../library/shutil.rst:647
msgid ""
"*extract_dir* is the name of the target directory where the archive is "
"unpacked. If not provided, the current working directory is used."
msgstr "*extract_dir* 是归档文件解包的目标目录名称。 如果未提供,则将使用当前工作目录。"
#: ../../library/shutil.rst:650
msgid ""
"*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", "
"\"bztar\", or \"xztar\". Or any other format registered with "
":func:`register_unpack_format`. If not provided, :func:`unpack_archive` "
"will use the archive file name extension and see if an unpacker was "
"registered for that extension. In case none is found, a :exc:`ValueError` "
"is raised."
msgstr ""
"*format* 是归档格式:应为 \"zip\", \"tar\", \"gztar\", \"bztar\" 或 \"xztar\" 之一。 "
"或者任何通过 :func:`register_unpack_format` 注册的其他格式。 如果未提供,:func:`unpack_archive` "
"将使用归档文件的扩展名来检查是否注册了对应于该扩展名的解包器。 在未找到任何解包器的情况下,将引发 :exc:`ValueError`。"
#: ../../library/shutil.rst:657
msgid ""
"The keyword-only *filter* argument, which was added in Python 3.8.17, is "
"passed to the underlying unpacking function. For zip files, *filter* is not "
"accepted. For tar files, it is recommended to set it to ``'data'``, unless "
"using features specific to tar and UNIX-like filesystems. (See "
":ref:`tarfile-extraction-filter` for details.) The ``'data'`` filter will "
"become the default for tar files in Python 3.14."
msgstr ""
#: ../../library/shutil.rst:667
msgid ""
"Raises an :ref:`auditing event <auditing>` ``shutil.unpack_archive`` with "
"arguments ``filename``, ``extract_dir``, ``format``."
msgstr ""
"引发一个 :ref:`审计事件 <auditing>` ``shutil.unpack_archive`` 并附带参数 ``filename``, "
"``extract_dir``, ``format``。"
#: ../../library/shutil.rst:670
msgid ""
"Never extract archives from untrusted sources without prior inspection. It "
"is possible that files are created outside of the path specified in the "
"*extract_dir* argument, e.g. members that have absolute filenames starting "
"with \"/\" or filenames with two dots \"..\"."
msgstr ""
"绝不要未经预先检验就从不可靠的源中提取归档文件。 这样有可能会在 *extract_dir* 参数所指定的路径之外创建文件,例如某些成员具有以 "
"\"/\" 打头的绝对路径文件名或是以两个点号 \"..\" 打头的文件名。"
#: ../../library/shutil.rst:675
msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*."
msgstr "接受一个 :term:`path-like object` 作为 *filename* 和 *extract_dir*。"
#: ../../library/shutil.rst:678
msgid "Added the *filter* argument."
msgstr "增加了 *filter* 参数。"
#: ../../library/shutil.rst:683
msgid ""
"Registers an unpack format. *name* is the name of the format and "
"*extensions* is a list of extensions corresponding to the format, like "
"``.zip`` for Zip files."
msgstr ""
"注册一个解包格式。 *name* 为格式名称而 *extensions* 为对应于该格式的扩展名列表,例如 Zip 文件的扩展名为 ``.zip``。"
#: ../../library/shutil.rst:687
msgid ""
"*function* is the callable that will be used to unpack archives. The "
"callable will receive:"
msgstr "*function* 是将被用于解包归档的可调用对象。 该可调用对象将接受:"
#: ../../library/shutil.rst:690
msgid "the path of the archive, as a positional argument;"
msgstr "归档的路径,为位置参数;"
#: ../../library/shutil.rst:691
msgid ""
"the directory the archive must be extracted to, as a positional argument;"
msgstr "归档要提取到的目录,为位置参数;"
#: ../../library/shutil.rst:692
msgid ""
"possibly a *filter* keyword argument, if it was given to "
":func:`unpack_archive`;"
msgstr "可选的 *filter* 关键字参数,如果有提供给 :func:`unpack_archive` 的话;"
#: ../../library/shutil.rst:694
msgid ""