-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathemail.policy.po
More file actions
917 lines (814 loc) · 48.2 KB
/
email.policy.po
File metadata and controls
917 lines (814 loc) · 48.2 KB
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
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-22 21:56+0000\n"
"PO-Revision-Date: 2025-09-22 17:55+0000\n"
"Last-Translator: python-doc bot, 2025\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/email.policy.rst:2
msgid ":mod:`email.policy`: Policy Objects"
msgstr ":mod:`email.policy`: Policy 对象"
#: ../../library/email.policy.rst:12
msgid "**Source code:** :source:`Lib/email/policy.py`"
msgstr "**源代码:** :source:`Lib/email/policy.py`"
#: ../../library/email.policy.rst:16
msgid ""
"The :mod:`email` package's prime focus is the handling of email messages as "
"described by the various email and MIME RFCs. However, the general format "
"of email messages (a block of header fields each consisting of a name "
"followed by a colon followed by a value, the whole block followed by a blank"
" line and an arbitrary 'body'), is a format that has found utility outside "
"of the realm of email. Some of these uses conform fairly closely to the "
"main email RFCs, some do not. Even when working with email, there are times"
" when it is desirable to break strict compliance with the RFCs, such as "
"generating emails that interoperate with email servers that do not "
"themselves follow the standards, or that implement extensions you want to "
"use in ways that violate the standards."
msgstr ""
":mod:`email` 的主要焦点是按照各种电子邮件和 MIME RFC 的描述来处理电子邮件消息。 "
"但是电子邮件消息的基本格式(一个由名称加冒号加值的标头字段构成的区块,后面再加一个空白行和任意的‘消息体’)是在电子邮件领域以外也获得应用的格式。 "
"这些应用的规则有些与主要电子邮件 RFC 十分接近,有些则很不相同。 即使是操作电子邮件,有时也可能需要打破严格的 RFC "
"规则,例如生成可与某些并不遵循标准的电子邮件服务器互联的电子邮件,或者是实现希望应用某些破坏标准的操作方式的扩展。"
#: ../../library/email.policy.rst:28
msgid ""
"Policy objects give the email package the flexibility to handle all these "
"disparate use cases."
msgstr "Policy 对象给予 email 包处理这些不同用例的灵活性。"
#: ../../library/email.policy.rst:31
msgid ""
"A :class:`Policy` object encapsulates a set of attributes and methods that "
"control the behavior of various components of the email package during use. "
":class:`Policy` instances can be passed to various classes and methods in "
"the email package to alter the default behavior. The settable values and "
"their defaults are described below."
msgstr ""
":class:`Policy` 对象封装了一组属性和方法用来在使用期间控制 email 包中各个组件的行为。 :class:`Policy` "
"实例可以被传给 email 包中的多个类和方法以更改它们的默认行为。 可设置的值及其默认值如下所述。"
#: ../../library/email.policy.rst:37
msgid ""
"There is a default policy used by all classes in the email package. For all"
" of the :mod:`~email.parser` classes and the related convenience functions, "
"and for the :class:`~email.message.Message` class, this is the "
":class:`Compat32` policy, via its corresponding pre-defined instance "
":const:`compat32`. This policy provides for complete backward compatibility"
" (in some cases, including bug compatibility) with the pre-Python3.3 version"
" of the email package."
msgstr ""
"在 email 包中的所有类会使用一个默认的策略。 对于所有 :mod:`~email.parser` 类及相关的便捷函数,还有对于 "
":class:`~email.message.Message` 类来说,它是 :class:`Compat32` 策略,通过其对应的预定义实例 "
":const:`compat32` 来使用。 这个策略提供了与 Python3.3 版之前的 email "
"包的完全向下兼容性(在某些情况下,也包括对缺陷的兼容性)。"
#: ../../library/email.policy.rst:44
msgid ""
"This default value for the *policy* keyword to "
":class:`~email.message.EmailMessage` is the :class:`EmailPolicy` policy, via"
" its pre-defined instance :data:`~default`."
msgstr ""
"传给 :class:`~email.message.EmailMessage` 的 *policy* 关键字的默认值是 "
":class:`EmailPolicy` 策略,表示为其预定义的实例 :data:`~default`。"
#: ../../library/email.policy.rst:48
msgid ""
"When a :class:`~email.message.Message` or "
":class:`~email.message.EmailMessage` object is created, it acquires a "
"policy. If the message is created by a :mod:`~email.parser`, a policy "
"passed to the parser will be the policy used by the message it creates. If "
"the message is created by the program, then the policy can be specified when"
" it is created. When a message is passed to a :mod:`~email.generator`, the "
"generator uses the policy from the message by default, but you can also pass"
" a specific policy to the generator that will override the one stored on the"
" message object."
msgstr ""
"在创建 :class:`~email.message.Message` 或 :class:`~email.message.EmailMessage` "
"对象时,它需要一个策略。 如果消息是由 :mod:`~email.parser` 创建的,则传给该解析器的策略将是它所创建的消息所使用的策略。 "
"如果消息是由程序创建的,则该策略可以在创建它的时候指定。 当消息被传递给 :mod:`~email.generator` "
"时,生成器默认会使用来自该消息的策略,但你也可以将指定的策略传递给生成器,这将覆盖存储在消息对象上的策略。"
#: ../../library/email.policy.rst:57
msgid ""
"The default value for the *policy* keyword for the :mod:`email.parser` "
"classes and the parser convenience functions **will be changing** in a "
"future version of Python. Therefore you should **always specify explicitly "
"which policy you want to use** when calling any of the classes and functions"
" described in the :mod:`~email.parser` module."
msgstr ""
":mod:`email.parser` 类和解析器便捷函数的 *policy* 关键字的默认值在未来的 Python 版本中 **将会改变**。 "
"因此在调用任何 :mod:`~email.parser` 模块所描述的类和函数时你应当 **总是显式地指定你想要使用的策略**。"
#: ../../library/email.policy.rst:63
msgid ""
"The first part of this documentation covers the features of :class:`Policy`,"
" an :term:`abstract base class` that defines the features that are common to"
" all policy objects, including :const:`compat32`. This includes certain "
"hook methods that are called internally by the email package, which a custom"
" policy could override to obtain different behavior. The second part "
"describes the concrete classes :class:`EmailPolicy` and :class:`Compat32`, "
"which implement the hooks that provide the standard behavior and the "
"backward compatible behavior and features, respectively."
msgstr ""
"本文档的第一部分介绍了 :class:`Policy` 的特性,它是一个 :term:`abstract base class`,定义了所有策略对象包括"
" :const:`compat32` 的共有特性。 这些特性包括一些由 email 包内部调用的特定钩子方法,自定义策略可以重写这些方法以获得不同行为。"
" 第二部分描述了实体类 :class:`EmailPolicy` 和 "
":class:`Compat32`,它们分别实现了提供标准行为和向下兼容行为与特性的钩子。"
#: ../../library/email.policy.rst:72
msgid ""
":class:`Policy` instances are immutable, but they can be cloned, accepting "
"the same keyword arguments as the class constructor and returning a new "
":class:`Policy` instance that is a copy of the original but with the "
"specified attributes values changed."
msgstr ""
":class:`Policy` 实例是不可变的,但它们可以被克隆,接受与类构造器一致的关键字参数并返回一个新的 :class:`Policy` "
"实例,新实例是原实例的副本,但具有被改变的指定属性。"
#: ../../library/email.policy.rst:77
msgid ""
"As an example, the following code could be used to read an email message "
"from a file on disk and pass it to the system ``sendmail`` program on a Unix"
" system:"
msgstr "例如,以下代码可以被用来从一个 Unix 系统的磁盘文件中读取电子邮件消息并将其传递给系统的 ``sendmail`` 程序:"
#: ../../library/email.policy.rst:113
msgid ""
"Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC "
"correct line separator characters when creating the binary string to feed "
"into ``sendmail's`` ``stdin``, where the default policy would use ``\\n`` "
"line separators."
msgstr ""
"这里我们让 :class:`~email.generator.BytesGenerator` 在创建要送入 ``sendmail's`` "
"``stdin`` 的二进制字串时使用符合 RFC 的行分隔字符,默认的策略将会使用 ``\\n`` 行分隔符。"
#: ../../library/email.policy.rst:118
msgid ""
"Some email package methods accept a *policy* keyword argument, allowing the "
"policy to be overridden for that method. For example, the following code "
"uses the :meth:`~email.message.Message.as_bytes` method of the *msg* object "
"from the previous example and writes the message to a file using the native "
"line separators for the platform on which it is running::"
msgstr ""
"某些 email 包的方法接受一个 *policy* 关键字参数,允许为该方法覆盖原有策略。 例如,以下代码使用了来自之前示例的 *msg* 对象的 "
":meth:`~email.message.Message.as_bytes` 方法并使用其运行所在平台的本机行分隔符将消息写入一个文件::"
#: ../../library/email.policy.rst:129
msgid ""
"Policy objects can also be combined using the addition operator, producing a"
" policy object whose settings are a combination of the non-default values of"
" the summed objects::"
msgstr "Policy 对象也可使用加法运算符进行组合来产生一个新策略对象,其设置是被加总对象的非默认值的组合::"
#: ../../library/email.policy.rst:137
msgid ""
"This operation is not commutative; that is, the order in which the objects "
"are added matters. To illustrate::"
msgstr "此运算不满足交换律;也就是说对象的添加顺序很重要。 见以下演示::"
#: ../../library/email.policy.rst:152
msgid ""
"This is the :term:`abstract base class` for all policy classes. It provides"
" default implementations for a couple of trivial methods, as well as the "
"implementation of the immutability property, the :meth:`clone` method, and "
"the constructor semantics."
msgstr ""
"这是所有策略类的 :term:`abstract base class`。 "
"它提供了一些简单方法的默认实现,以及不可变特征属性,:meth:`clone` 方法以及构造器语义的实现。"
#: ../../library/email.policy.rst:157
msgid ""
"The constructor of a policy class can be passed various keyword arguments. "
"The arguments that may be specified are any non-method properties on this "
"class, plus any additional non-method properties on the concrete class. A "
"value specified in the constructor will override the default value for the "
"corresponding attribute."
msgstr ""
"可以向策略类的构造器传入各种关键字参数。 可以指定的参数是该类的任何非方法特征属性,以及实体类的任何额外非方法特征属性。 "
"在构造器中指定的值将覆盖相应属性的默认值。"
#: ../../library/email.policy.rst:163
msgid ""
"This class defines the following properties, and thus values for the "
"following may be passed in the constructor of any policy class:"
msgstr "这个类定义了下列特征属性,因此下列值可以被传给任何策略类的构造器:"
#: ../../library/email.policy.rst:169
msgid ""
"The maximum length of any line in the serialized output, not counting the "
"end of line character(s). Default is 78, per :rfc:`5322`. A value of ``0``"
" or :const:`None` indicates that no line wrapping should be done at all."
msgstr ""
"序列化输出中任何行的最大长度,不计入行字符的末尾。 默认值为 78,基于 :rfc:`5322`。 值为 ``0`` 或 :const:`None` "
"表示完全没有行包装。"
#: ../../library/email.policy.rst:177
msgid ""
"The string to be used to terminate lines in serialized output. The default "
"is ``\\n`` because that's the internal end-of-line discipline used by "
"Python, though ``\\r\\n`` is required by the RFCs."
msgstr ""
"用来在序列化输出中确定行的字符串。 默认值为 ``\\n`` 因为这是 Python 所使用的内部行结束符规范,但 RFC 的要求是 "
"``\\r\\n``。"
#: ../../library/email.policy.rst:184
msgid ""
"Controls the type of Content Transfer Encodings that may be or are required "
"to be used. The possible values are:"
msgstr "控制可能要求使用的内容传输编码格式类型。 可能的值包括:"
#: ../../library/email.policy.rst:190
msgid "``7bit``"
msgstr "``7bit``"
#: ../../library/email.policy.rst:190
msgid ""
"all data must be \"7 bit clean\" (ASCII-only). This means that where "
"necessary data will be encoded using either quoted-printable or base64 "
"encoding."
msgstr "所有数据必须为 \"纯 7 比特位\" (仅 ASCII)。 这意味着在必要情况下数据将使用可打印引用形式或 base64 编码格式进行编码。"
#: ../../library/email.policy.rst:194
msgid "``8bit``"
msgstr "``8bit``"
#: ../../library/email.policy.rst:194
msgid ""
"data is not constrained to be 7 bit clean. Data in headers is still "
"required to be ASCII-only and so will be encoded (see :meth:`fold_binary` "
"and :attr:`~EmailPolicy.utf8` below for exceptions), but body parts may use "
"the ``8bit`` CTE."
msgstr ""
"数据不会被限制为纯 7 比特位。 标头中的数据仍要求仅 ASCII 因此将被编码(参阅下文的 :meth:`fold_binary` 和 "
":attr:`~EmailPolicy.utf8` 了解例外情况),但消息体部分可能使用 ``8bit`` CTE。"
#: ../../library/email.policy.rst:200
msgid ""
"A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not "
"``Generator``, because strings cannot contain binary data. If a "
"``Generator`` is operating under a policy that specifies ``cte_type=8bit``, "
"it will act as if ``cte_type`` is ``7bit``."
msgstr ""
"``cte_type`` 值为 ``8bit`` 仅适用于 ``BytesGenerator`` 而非 "
"``Generator``,因为字符串不能包含二进制数据。 如果 ``Generator`` 运行于指定了 ``cte_type=8bit`` "
"的策略,它的行为将与 ``cte_type`` 为 ``7bit`` 相同。"
#: ../../library/email.policy.rst:208
msgid ""
"If :const:`True`, any defects encountered will be raised as errors. If "
":const:`False` (the default), defects will be passed to the "
":meth:`register_defect` method."
msgstr ""
"如为 :const:`True`,则遇到的任何缺陷都将引发错误。 如为 :const:`False` (默认值),则缺陷将被传递给 "
":meth:`register_defect` 方法。"
#: ../../library/email.policy.rst:215
msgid ""
"If :const:`True`, lines starting with *\"From \"* in the body are escaped by"
" putting a ``>`` in front of them. This parameter is used when the message "
"is being serialized by a generator. Default: :const:`False`."
msgstr ""
"如为 :const:`True`,则消息体中以 *\"From \"* 开头的行会通过在其前面放一个 ``>`` 来进行转义。 "
"当消息被生成器执行序列化时会使用此形参。 默认值t: :const:`False`。"
#: ../../library/email.policy.rst:220
msgid "The *mangle_from_* parameter."
msgstr "*mangle_from_* 形参。"
#: ../../library/email.policy.rst:226
msgid ""
"A factory function for constructing a new empty message object. Used by the"
" parser when building messages. Defaults to ``None``, in which case "
":class:`~email.message.Message` is used."
msgstr ""
"用来构造新的空消息对象的工厂函数。 在构建消息时由解析器使用。 默认为 ``None``,在此情况下会使用 "
":class:`~email.message.Message`。"
#: ../../library/email.policy.rst:235
msgid ""
"If ``True`` (the default), the generator will raise "
":exc:`~email.errors.HeaderWriteError` instead of writing a header that is "
"improperly folded or delimited, such that it would be parsed as multiple "
"headers or joined with adjacent data. Such headers can be generated by "
"custom header classes or bugs in the ``email`` module."
msgstr ""
"如为 ``True`` (默认值),则生成器会引发 raise :exc:`~email.errors.HeaderWriteError` "
"而不是写入一个不正确地折叠或设限的标头,以便它可以被解析为多重标头或与相邻数据合并。 这样的标头可通过自定义标头类或 ``email`` "
"模块中的程序错误来生成。"
#: ../../library/email.policy.rst:242
msgid ""
"As it's a security feature, this defaults to ``True`` even in the "
":class:`~email.policy.Compat32` policy. For backwards compatible, but "
"unsafe, behavior, it must be set to ``False`` explicitly."
msgstr ""
"由于它是一个安全特性,即使是在 :class:`~email.policy.Compat32` 策略中该值也默认为 ``True``。 "
"为了保持向下兼容但是不安全的行为,它必须显式地被设为 ``False``。"
#: ../../library/email.policy.rst:250
msgid ""
"The following :class:`Policy` method is intended to be called by code using "
"the email library to create policy instances with custom settings:"
msgstr "下列 :class:`Policy` 方法是由使用 email 库的代码来调用以创建具有自室外设置的策略实例:"
#: ../../library/email.policy.rst:256
msgid ""
"Return a new :class:`Policy` instance whose attributes have the same values "
"as the current instance, except where those attributes are given new values "
"by the keyword arguments."
msgstr "返回一个新的 :class:`Policy` 实例,其属性与当前实例具有相同的值,除非是那些由关键字参数给出了新值的属性。"
#: ../../library/email.policy.rst:261
msgid ""
"The remaining :class:`Policy` methods are called by the email package code, "
"and are not intended to be called by an application using the email package."
" A custom policy must implement all of these methods."
msgstr ""
"其余的 :class:`Policy` 方法是由 email 包代码来调用的,而不应当被使用 email 包的应用程序所调用。 "
"自定义的策略必须实现所有这些方法。"
#: ../../library/email.policy.rst:268
msgid ""
"Handle a *defect* found on *obj*. When the email package calls this method,"
" *defect* will always be a subclass of :class:`~email.errors.Defect`."
msgstr ""
"处理在 *obj* 上发现的 *defect*。 当 email 包调用此方法时,*defect* 将总是 "
":class:`~email.errors.Defect` 的一个子类。"
#: ../../library/email.policy.rst:272
msgid ""
"The default implementation checks the :attr:`raise_on_defect` flag. If it "
"is ``True``, *defect* is raised as an exception. If it is ``False`` (the "
"default), *obj* and *defect* are passed to :meth:`register_defect`."
msgstr ""
"默认实现会检查 :attr:`raise_on_defect` 旗标。 如果其为 ``True``,则 *defect* 会被作为异常来引发。 如果其为"
" ``False`` (默认值),则 *obj* 和 *defect* 会被传递给 :meth:`register_defect`。"
#: ../../library/email.policy.rst:279
msgid ""
"Register a *defect* on *obj*. In the email package, *defect* will always be"
" a subclass of :class:`~email.errors.Defect`."
msgstr ""
"在 *obj* 上注册一个 *defect*。 在 email 包中,*defect* 将总是 "
":class:`~email.errors.Defect` 的一个子类。"
#: ../../library/email.policy.rst:282
msgid ""
"The default implementation calls the ``append`` method of the ``defects`` "
"attribute of *obj*. When the email package calls :attr:`handle_defect`, "
"*obj* will normally have a ``defects`` attribute that has an ``append`` "
"method. Custom object types used with the email package (for example, "
"custom ``Message`` objects) should also provide such an attribute, otherwise"
" defects in parsed messages will raise unexpected errors."
msgstr ""
"默认实现会调用 *obj* 的 ``defects`` 属性的 ``append`` 方法。 当 email 包调用 "
":attr:`handle_defect` 时,*obj* 通常将具有一个带 ``append`` 方法的 ``defects`` 属性。 配合 "
"email 包使用的自定义对象类型(例如自定义的 ``Message`` 对象)也应当提供这样的属性,否则在被解析消息中的缺陷将引发非预期的错误。"
#: ../../library/email.policy.rst:292
msgid "Return the maximum allowed number of headers named *name*."
msgstr "返回名为 *name* 的标头的最大允许数量。"
#: ../../library/email.policy.rst:294
msgid ""
"Called when a header is added to an :class:`~email.message.EmailMessage` or "
":class:`~email.message.Message` object. If the returned value is not ``0`` "
"or ``None``, and there are already a number of headers with the name *name* "
"greater than or equal to the value returned, a :exc:`ValueError` is raised."
msgstr ""
"当添加一个标头到 :class:`~email.message.EmailMessage` 或 "
":class:`~email.message.Message` 对象时被调用。 如果返回值不为 ``0`` 或 ``None``,并且已有的名称为 "
"*name* 的标头数量大于等于所返回的值,则会引发 :exc:`ValueError`。"
#: ../../library/email.policy.rst:300
msgid ""
"Because the default behavior of ``Message.__setitem__`` is to append the "
"value to the list of headers, it is easy to create duplicate headers without"
" realizing it. This method allows certain headers to be limited in the "
"number of instances of that header that may be added to a ``Message`` "
"programmatically. (The limit is not observed by the parser, which will "
"faithfully produce as many headers as exist in the message being parsed.)"
msgstr ""
"由于 ``Message.__setitem__`` 的默认行为是将值添加到标头列表,因此很容易不知情地创建重复的标头。 "
"此方法允许在程序中限制可以被添加到 ``Message`` 中的特定标头的实例数量。 "
"(解析器不会考虑此限制,它将忠实地产生被解析消息中存在的任意数量的标头。)"
#: ../../library/email.policy.rst:308
msgid "The default implementation returns ``None`` for all header names."
msgstr "默认实现对于所有标头名称都返回 ``None``。"
#: ../../library/email.policy.rst:313
msgid ""
"The email package calls this method with a list of strings, each string "
"ending with the line separation characters found in the source being parsed."
" The first line includes the field header name and separator. All "
"whitespace in the source is preserved. The method should return the "
"``(name, value)`` tuple that is to be stored in the ``Message`` to represent"
" the parsed header."
msgstr ""
"email 包调用此方法时将传入一个字符串列表,其中每个字符串以在被解析源中找到的行分隔符结束。 第一行包括字段标头名称和分隔符。 "
"源中的所有空白符都会被保留。 此方法应当返回 ``(name, value)`` 元组以保存至 ``Message`` 中来代表被解析的标头。"
#: ../../library/email.policy.rst:320
msgid ""
"If an implementation wishes to retain compatibility with the existing email "
"package policies, *name* should be the case preserved name (all characters "
"up to the '``:``' separator), while *value* should be the unfolded value "
"(all line separator characters removed, but whitespace kept intact), "
"stripped of leading whitespace."
msgstr ""
"如果一个实现希望保持与现有 email 包策略的兼容性,则 *name* 应当为保留大小写形式的名称(所有字符直至 '``:``' 分隔符),而 "
"*value* 应当为展开后的值(移除所有行分隔符,但空白符保持不变),并移除开头的空白符。"
#: ../../library/email.policy.rst:326
msgid "*sourcelines* may contain surrogateescaped binary data."
msgstr "*sourcelines* 可以包含经替代转义的二进制数据。"
#: ../../library/email.policy.rst:328 ../../library/email.policy.rst:344
#: ../../library/email.policy.rst:360
msgid "There is no default implementation"
msgstr "此方法没有默认实现"
#: ../../library/email.policy.rst:333
msgid ""
"The email package calls this method with the name and value provided by the "
"application program when the application program is modifying a ``Message`` "
"programmatically (as opposed to a ``Message`` created by a parser). The "
"method should return the ``(name, value)`` tuple that is to be stored in the"
" ``Message`` to represent the header."
msgstr ""
"当一个应用通过程序代码修改 ``Message`` (而不是由解析器创建 ``Message``) 时,email "
"包会调用此方法并附带应用程序所提供的名称和值。 此方法应当返回 ``(name, value)`` 元组以保存至 ``Message`` "
"中用来表示标头。"
#: ../../library/email.policy.rst:339
msgid ""
"If an implementation wishes to retain compatibility with the existing email "
"package policies, the *name* and *value* should be strings or string "
"subclasses that do not change the content of the passed in arguments."
msgstr ""
"如果一个实现希望保持与现有 email 包策略的兼容性,则 *name* 和 *value* "
"应当为字符串或字符串的子类,它们不会修改在参数中传入的内容。"
#: ../../library/email.policy.rst:349
msgid ""
"The email package calls this method with the *name* and *value* currently "
"stored in the ``Message`` when that header is requested by the application "
"program, and whatever the method returns is what is passed back to the "
"application as the value of the header being retrieved. Note that there may "
"be more than one header with the same name stored in the ``Message``; the "
"method is passed the specific name and value of the header destined to be "
"returned to the application."
msgstr ""
"当标头被应用程序所请求时,email 包会调用此方法并附带当前保存在 ``Message`` 中的 *name* 和 "
"*value*,并且无论此方法返回什么它都会被回传给应用程序作为被提取标头的值。 请注意可能会有多个相同名称的标头被保存在 ``Message`` "
"中;此方法会将指定标头的名称和值返回给应用程序。"
#: ../../library/email.policy.rst:357
msgid ""
"*value* may contain surrogateescaped binary data. There should be no "
"surrogateescaped binary data in the value returned by the method."
msgstr "*value* 可能包含经替代转义的二进制数据。 此方法所返回的值应当没有经替代转义的二进制数据。"
#: ../../library/email.policy.rst:365
msgid ""
"The email package calls this method with the *name* and *value* currently "
"stored in the ``Message`` for a given header. The method should return a "
"string that represents that header \"folded\" correctly (according to the "
"policy settings) by composing the *name* with the *value* and inserting "
":attr:`linesep` characters at the appropriate places. See :rfc:`5322` for a"
" discussion of the rules for folding email headers."
msgstr ""
"email 包调用此方法时会附带当前保存在 ``Message`` 中的给定标头的 *name* 和 *value*。 "
"此方法应当返回一个代表该标头的(根据策略设置)通过处理 *name* 和 *value* 并在适当位置插入 :attr:`linesep` "
"字符来正确地“折叠”的字符串。 请参阅 :rfc:`5322` 了解有关折叠电子邮件标头的规则的讨论。"
#: ../../library/email.policy.rst:372
msgid ""
"*value* may contain surrogateescaped binary data. There should be no "
"surrogateescaped binary data in the string returned by the method."
msgstr "*value* 可能包含经替代转义的二进制数据。 此方法所返回的字符串应当没有经替代转义的二进制数据。"
#: ../../library/email.policy.rst:378
msgid ""
"The same as :meth:`fold`, except that the returned value should be a bytes "
"object rather than a string."
msgstr "与 :meth:`fold` 类似,不同之处在于返回的值应当为字节串对象而非字符串。"
#: ../../library/email.policy.rst:381
msgid ""
"*value* may contain surrogateescaped binary data. These could be converted "
"back into binary data in the returned bytes object."
msgstr "*value* 可能包含经替代转义的二进制数据。 这些数据可以在被返回的字节串对象中被转换回二进制数据。"
#: ../../library/email.policy.rst:388
msgid ""
"This concrete :class:`Policy` provides behavior that is intended to be fully"
" compliant with the current email RFCs. These include (but are not limited "
"to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs."
msgstr ""
"这个实体 :class:`Policy` 提供了完全遵循当前电子邮件 RFC 的行为。 这包括 (但不限于) :rfc:`5322`, "
":rfc:`2047` 以及当前的各种 MIME RFC。"
#: ../../library/email.policy.rst:392
msgid ""
"This policy adds new header parsing and folding algorithms. Instead of "
"simple strings, headers are ``str`` subclasses with attributes that depend "
"on the type of the field. The parsing and folding algorithm fully implement"
" :rfc:`2047` and :rfc:`5322`."
msgstr ""
"此策略添加了新的标头解析和折叠算法。 标头不是简单的字符串,而是带有依赖于字段类型的属性的 ``str`` 的子类。 这个解析和折叠算法完整实现了 "
":rfc:`2047` 和 :rfc:`5322`。"
#: ../../library/email.policy.rst:397
msgid ""
"The default value for the :attr:`~email.policy.Policy.message_factory` "
"attribute is :class:`~email.message.EmailMessage`."
msgstr ""
":attr:`~email.policy.Policy.message_factory` 属性的默认值为 "
":class:`~email.message.EmailMessage`。"
#: ../../library/email.policy.rst:400
msgid ""
"In addition to the settable attributes listed above that apply to all "
"policies, this policy adds the following additional attributes:"
msgstr "除了上面列出的适用于所有策略的可设置属性,此策略还添加了下列额外属性:"
#: ../../library/email.policy.rst:403
msgid "[1]_"
msgstr "[1]_"
#: ../../library/email.policy.rst:408
msgid ""
"If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers"
" by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and"
" use ``utf-8`` encoding for headers. Messages formatted in this way may be "
"passed to SMTP servers that support the ``SMTPUTF8`` extension "
"(:rfc:`6531`)."
msgstr ""
"如为 ``False``,则遵循 :rfc:`5322`,通过编码为“已编码字”来支持标头中的非 ASCII 字符。 如为 ``True``,则遵循 "
":rfc:`6532` 并对标头使用 ``utf-8`` 编码格式。 以此方式格式化的消息可被传递给支持 ``SMTPUTF8`` 扩展 "
"(:rfc:`6531`) 的 SMTP 服务器。"
#: ../../library/email.policy.rst:417
msgid ""
"If the value for a header in the ``Message`` object originated from a "
":mod:`~email.parser` (as opposed to being set by a program), this attribute "
"indicates whether or not a generator should refold that value when "
"transforming the message back into serialized form. The possible values "
"are:"
msgstr ""
"如果 ``Message`` 对象中标头的值源自 :mod:`~email.parser` "
"(而非由程序设置),此属性会表明当将消息转换回序列化形式时是否应当由生成器来重新折叠该值。 可能的值如下:"
#: ../../library/email.policy.rst:424
msgid "``none``"
msgstr "``none``"
#: ../../library/email.policy.rst:424
msgid "all source values use original folding"
msgstr "所有源值使用原始折叠"
#: ../../library/email.policy.rst:426
msgid "``long``"
msgstr "``long``"
#: ../../library/email.policy.rst:426
msgid ""
"source values that have any line that is longer than ``max_line_length`` "
"will be refolded"
msgstr "具有任何长度超过 ``max_line_length`` 的行的源值将被折叠"
#: ../../library/email.policy.rst:429
msgid "``all``"
msgstr "``all``"
#: ../../library/email.policy.rst:429
msgid "all values are refolded."
msgstr "所有值会被重新折叠。"
#: ../../library/email.policy.rst:432
msgid "The default is ``long``."
msgstr "默认值为 ``long``。"
#: ../../library/email.policy.rst:437
msgid ""
"A callable that takes two arguments, ``name`` and ``value``, where ``name`` "
"is a header field name and ``value`` is an unfolded header field value, and "
"returns a string subclass that represents that header. A default "
"``header_factory`` (see :mod:`~email.headerregistry`) is provided that "
"supports custom parsing for the various address and date :RFC:`5322` header "
"field types, and the major MIME header field stypes. Support for additional"
" custom parsing will be added in the future."
msgstr ""
"该可调用对象接受两个参数,``name`` 和 ``value``,其中 ``name`` 为标头字段名而 ``value`` "
"为展开后的标头字段值,并返回一个表示该标头的字符串子类。 已提供的默认 ``header_factory`` (参见 "
":mod:`~email.headerregistry`) 支持对各种地址和日期 :RFC:`5322` 标头字段类型及主要 MIME "
"标头字段类型的自定义解析。 未来还将添加对其他自定义解析的支持。"
#: ../../library/email.policy.rst:448
msgid ""
"An object with at least two methods: get_content and set_content. When the "
":meth:`~email.message.EmailMessage.get_content` or "
":meth:`~email.message.EmailMessage.set_content` method of an "
":class:`~email.message.EmailMessage` object is called, it calls the "
"corresponding method of this object, passing it the message object as its "
"first argument, and any arguments or keywords that were passed to it as "
"additional arguments. By default ``content_manager`` is set to "
":data:`~email.contentmanager.raw_data_manager`."
msgstr ""
"此对象至少有两个方法: get_content 和 set_content。 当一个 "
":class:`~email.message.EmailMessage` 对象的 "
":meth:`~email.message.EmailMessage.get_content` 或 "
":meth:`~email.message.EmailMessage.set_content` "
"方法被调用时,它会调用此对象的相应方法,将消息对象作为其第一个参数,并将传给它的任何参数或关键字作为附加参数传入。 默认情况下 "
"``content_manager`` 会被设为 :data:`~email.contentmanager.raw_data_manager`。"
#: ../../library/email.policy.rst:460 ../../library/email.policy.rst:618
msgid ""
"The class provides the following concrete implementations of the abstract "
"methods of :class:`Policy`:"
msgstr "这个类提供了下列对 :class:`Policy` 的抽象方法的具体实现:"
#: ../../library/email.policy.rst:466
msgid ""
"Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` "
"attribute of the specialized class used to represent the header with the "
"given name."
msgstr ""
"返回用来表示具有给定名称的标头的专用类的 :attr:`~email.headerregistry.BaseHeader.max_count` "
"属性的值。"
#: ../../library/email.policy.rst:474 ../../library/email.policy.rst:624
msgid ""
"The name is parsed as everything up to the '``:``' and returned unmodified."
" The value is determined by stripping leading whitespace off the remainder "
"of the first line, joining all subsequent lines together, and stripping any "
"trailing carriage return or linefeed characters."
msgstr ""
"此名称会被作为到 '``:``' 止的所有内容来解析。 "
"该值是通过从第一行的剩余部分去除前导空格,再将所有后续行连接到一起,并去除所有末尾回车符或换行符来确定的。"
#: ../../library/email.policy.rst:482
msgid ""
"The name is returned unchanged. If the input value has a ``name`` attribute"
" and it matches *name* ignoring case, the value is returned unchanged. "
"Otherwise the *name* and *value* are passed to ``header_factory``, and the "
"resulting header object is returned as the value. In this case a "
"``ValueError`` is raised if the input value contains CR or LF characters."
msgstr ""
"name 将会被原样返回。 如果输入值具有 ``name`` 属性并可在忽略大小写的情况下匹配 *name*,则 value 也会被原样返回。 "
"在其他情况下 *name* 和 *value* 会被传递给 ``header_factory``,并将结果标头对象作为值返回。 在此情况下如果输入值包含"
" CR 或 LF 字符则会引发 ``ValueError``。"
#: ../../library/email.policy.rst:492
msgid ""
"If the value has a ``name`` attribute, it is returned to unmodified. "
"Otherwise the *name*, and the *value* with any CR or LF characters removed, "
"are passed to the ``header_factory``, and the resulting header object is "
"returned. Any surrogateescaped bytes get turned into the unicode unknown-"
"character glyph."
msgstr ""
"如果值具有 ``name`` 属性,它会被原样返回。 在其他情况下 *name* 和移除了所有 CR 和 LF 字符的 *value* 会被传递给 "
"``header_factory``,并返回结果标头对象。 任何经替代转义的字节串会被转换为 unicode 未知字符字形。"
#: ../../library/email.policy.rst:501
msgid ""
"Header folding is controlled by the :attr:`refold_source` policy setting. A "
"value is considered to be a 'source value' if and only if it does not have a"
" ``name`` attribute (having a ``name`` attribute means it is a header object"
" of some sort). If a source value needs to be refolded according to the "
"policy, it is converted into a header object by passing the *name* and the "
"*value* with any CR and LF characters removed to the ``header_factory``. "
"Folding of a header object is done by calling its ``fold`` method with the "
"current policy."
msgstr ""
"标头折叠是由 :attr:`refold_source` 策略设置来控制的。 当且仅当一个值没有 ``name`` 属性(具有 ``name`` "
"属性就意味着它是某种标头对象)它才会被当作是“源值”。 如果一个原值需要按照策略来重新折叠,则会通过将 *name* 和去除了所有 CR 和 LF "
"字符的 *value* 传递给 ``header_factory`` 来将其转换为标头对象。 标头对象的折叠是通过调用其 ``fold`` "
"方法并附带当前策略来完成的。"
#: ../../library/email.policy.rst:510
msgid ""
"Source values are split into lines using :meth:`~str.splitlines`. If the "
"value is not to be refolded, the lines are rejoined using the ``linesep`` "
"from the policy and returned. The exception is lines containing non-ascii "
"binary data. In that case the value is refolded regardless of the "
"``refold_source`` setting, which causes the binary data to be CTE encoded "
"using the ``unknown-8bit`` charset."
msgstr ""
"源值会使用 :meth:`~str.splitlines` 来拆分成多行。 如果该值不被重新折叠,则会使用策略中的 ``linesep`` "
"重新合并这些行并将其返回。 例外的是包含非 ascii 二进制数据的行。 在此情况下无论 ``refold_source`` "
"如何设置该值都会被重新折叠,这会导致二进制数据使用 ``unknown-8bit`` 字符集进行 CTE 编码。"
#: ../../library/email.policy.rst:520
msgid ""
"The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except "
"that the returned value is bytes."
msgstr ""
"如果 :attr:`~Policy.cte_type` 为 ``7bit`` 则与 :meth:`fold` 类似,不同之处在于返回的值是字节串。"
#: ../../library/email.policy.rst:523
msgid ""
"If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted "
"back into bytes. Headers with binary data are not refolded, regardless of "
"the ``refold_header`` setting, since there is no way to know whether the "
"binary data consists of single byte characters or multibyte characters."
msgstr ""
"如果 :attr:`~Policy.cte_type` 为 ``8bit``,则将非 ASCII 二进制数据转换回字节串。 "
"带有二进制数据的标头不会被重新折叠,无论 ``refold_header`` 设置如何,因为无法知晓该二进制数据是由单字节字符还是多字节字符组成的。"
#: ../../library/email.policy.rst:530
msgid ""
"The following instances of :class:`EmailPolicy` provide defaults suitable "
"for specific application domains. Note that in the future the behavior of "
"these instances (in particular the ``HTTP`` instance) may be adjusted to "
"conform even more closely to the RFCs relevant to their domains."
msgstr ""
"以下 :class:`EmailPolicy` 的实例提供了适用于特定应用领域的默认值。 请注意在未来这些实例(特别是 ``HTTP`` "
"实例)的行为可能会被调整以便更严格地遵循与其领域相关的 RFC。"
#: ../../library/email.policy.rst:538
msgid ""
"An instance of ``EmailPolicy`` with all defaults unchanged. This policy "
"uses the standard Python ``\\n`` line endings rather than the RFC-correct "
"``\\r\\n``."
msgstr ""
"一个未改变任何默认值的 ``EmailPolicy`` 实例。 此策略使用标准的 Python ``\\n`` 行结束符而非遵循 RFC 的 "
"``\\r\\n``。"
#: ../../library/email.policy.rst:545
msgid ""
"Suitable for serializing messages in conformance with the email RFCs. Like "
"``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant."
msgstr ""
"适用于按照符合电子邮件 RFC 的方式来序列化消息。 与 ``default`` 类似,但 ``linesep`` 被设为遵循 RFC 的 "
"``\\r\\n``。"
#: ../../library/email.policy.rst:552
msgid ""
"The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. "
"Useful for serializing messages to a message store without using encoded "
"words in the headers. Should only be used for SMTP transmission if the "
"sender or recipient addresses have non-ASCII characters (the "
":meth:`smtplib.SMTP.send_message` method handles this automatically)."
msgstr ""
"与 ``SMTP`` 类似但是 :attr:`~EmailPolicy.utf8` 为 ``True``。 "
"适用于在不使用标头内已编码字的情况下对消息进行序列化。 如果发送方或接收方地址具有非 ASCII 字符则应当只被用于 SMTP 传输 "
"(:meth:`smtplib.SMTP.send_message` 方法会自动如此处理)。"
#: ../../library/email.policy.rst:561
msgid ""
"Suitable for serializing headers with for use in HTTP traffic. Like "
"``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)."
msgstr ""
"适用于序列化标头以在 HTTP 通信中使用。 与 ``SMTP`` 类似但是 ``max_line_length`` 被设为 ``None`` "
"(无限制)。"
#: ../../library/email.policy.rst:567
msgid ""
"Convenience instance. The same as ``default`` except that "
"``raise_on_defect`` is set to ``True``. This allows any policy to be made "
"strict by writing::"
msgstr ""
"便捷实例。 与 ``default`` 类似但是 ``raise_on_defect`` 被设为 ``True``。 "
"这样可以允许通过以下写法来严格地设置任何策略::"
#: ../../library/email.policy.rst:574
msgid ""
"With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API "
"of the email package is changed from the Python 3.2 API in the following "
"ways:"
msgstr ""
"因为所有这些 :class:`EmailPolicies <.EmailPolicy>`,email 包的高效 API 相比 Python 3.2 "
"API 发生了以下几方面变化:"
#: ../../library/email.policy.rst:577
msgid ""
"Setting a header on a :class:`~email.message.Message` results in that header"
" being parsed and a header object created."
msgstr "在 :class:`~email.message.Message` 中设置标头将使得该标头被解析并创建一个标头对象。"
#: ../../library/email.policy.rst:580
msgid ""
"Fetching a header value from a :class:`~email.message.Message` results in "
"that header being parsed and a header object created and returned."
msgstr "从 :class:`~email.message.Message` 提取标头将使得该标头被解析并创建和返回一个标头对象。"
#: ../../library/email.policy.rst:584
msgid ""
"Any header object, or any header that is refolded due to the policy "
"settings, is folded using an algorithm that fully implements the RFC folding"
" algorithms, including knowing where encoded words are required and allowed."
msgstr ""
"任何标头对象或任何由于策略设置而被重新折叠的标头都会使用一种完全实现了 RFC 折叠算法的算法来进行折叠,包括知道在休息需要并允许已编码字。"
#: ../../library/email.policy.rst:589
msgid ""
"From the application view, this means that any header obtained through the "
":class:`~email.message.EmailMessage` is a header object with extra "
"attributes, whose string value is the fully decoded unicode value of the "
"header. Likewise, a header may be assigned a new value, or a new header "
"created, using a unicode string, and the policy will take care of converting"
" the unicode string into the correct RFC encoded form."
msgstr ""
"从应用程序的视角来看,这意味着任何通过 :class:`~email.message.EmailMessage` "
"获得的标头都是具有附加属性的标头对象,其字符串值都是该标头的完全解码后的 unicode 值。 类似地,可以使用 unicode "
"对象为一个标头赋予新的值,或创建一个新的标头对象,并且该策略将负责把该 unicode 字符串转换为正确的 RFC 已编码形式。"
#: ../../library/email.policy.rst:596
msgid ""
"The header objects and their attributes are described in "
":mod:`~email.headerregistry`."
msgstr "标头对象及其属性的描述见 :mod:`~email.headerregistry`。"
#: ../../library/email.policy.rst:603
msgid ""
"This concrete :class:`Policy` is the backward compatibility policy. It "
"replicates the behavior of the email package in Python 3.2. The "
":mod:`~email.policy` module also defines an instance of this class, "
":const:`compat32`, that is used as the default policy. Thus the default "
"behavior of the email package is to maintain compatibility with Python 3.2."
msgstr ""
"这个实体 :class:`Policy` 为向下兼容策略。 它复制了 Python 3.2 中 email 包的行为。 "
":mod:`~email.policy` 模块还定义了该类的一个实例 :const:`compat32`,用来作为默认策略。 因此 email "
"包的默认行为会保持与 Python 3.2 的兼容性。"
#: ../../library/email.policy.rst:609
msgid ""
"The following attributes have values that are different from the "
":class:`Policy` default:"
msgstr "下列属性具有与 :class:`Policy` 默认值不同的值:"
#: ../../library/email.policy.rst:615
msgid "The default is ``True``."
msgstr "默认值为 ``True``。"
#: ../../library/email.policy.rst:632
msgid "The name and value are returned unmodified."
msgstr "name 和 value 会被原样返回。"
#: ../../library/email.policy.rst:637
msgid ""
"If the value contains binary data, it is converted into a "
":class:`~email.header.Header` object using the ``unknown-8bit`` charset. "
"Otherwise it is returned unmodified."
msgstr ""
"如果 value 包含二进制数据,则会使用 ``unknown-8bit`` 字符集来将其转换为 "
":class:`~email.header.Header` 对象。 在其他情况下它会被原样返回。"
#: ../../library/email.policy.rst:644
msgid ""
"Headers are folded using the :class:`~email.header.Header` folding "
"algorithm, which preserves existing line breaks in the value, and wraps each"
" resulting line to the ``max_line_length``. Non-ASCII binary data are CTE "
"encoded using the ``unknown-8bit`` charset."
msgstr ""
"标头会使用 :class:`~email.header.Header` 折叠算法进行折叠,该算法保留 value "
"中现有的换行,并将每个结果行的长度折叠至 ``max_line_length``。 非 ASCII 二进制数据会使用 ``unknown-8bit`` "
"字符串进行 CTE 编码。"
#: ../../library/email.policy.rst:652
msgid ""
"Headers are folded using the :class:`~email.header.Header` folding "
"algorithm, which preserves existing line breaks in the value, and wraps each"
" resulting line to the ``max_line_length``. If ``cte_type`` is ``7bit``, "
"non-ascii binary data is CTE encoded using the ``unknown-8bit`` charset. "
"Otherwise the original source header is used, with its existing line breaks "
"and any (RFC invalid) binary data it may contain."
msgstr ""
"标头会使用 :class:`~email.header.Header` 折叠算法进行折叠,该算法保留 value "
"中现有的换行,并将每个结果行的长度折叠至 ``max_line_length``。 如果 ``cte_type`` 为 ``7bit``,则非 "
"ascii 二进制数据会使用 ``unknown-8bit`` 字符集进行 CTE 编码。 "
"在其他情况下则会使用原始的源标头,这将保留其现有的换行和所包含的任何(不符合 RFC 的)二进制数据。"
#: ../../library/email.policy.rst:662
msgid ""
"An instance of :class:`Compat32`, providing backward compatibility with the"
" behavior of the email package in Python 3.2."
msgstr ":class:`Compat32` 的实例,提供与 Python 3.2 中的 email 包行为的向下兼容性。"
#: ../../library/email.policy.rst:667
msgid "Footnotes"
msgstr "备注"
#: ../../library/email.policy.rst:668
msgid ""
"Originally added in 3.3 as a :term:`provisional feature <provisional "
"package>`."
msgstr "最初在 3.3 中作为 :term:`暂定特性 <provisional package>` 添加。"