|
18 | 18 | import email.policy
|
19 | 19 |
|
20 | 20 | from email.charset import Charset
|
21 |
| -from email.header import Header, decode_header, make_header |
22 |
| -from email.parser import Parser, HeaderParser |
23 | 21 | from email.generator import Generator, DecodedGenerator, BytesGenerator
|
| 22 | +from email.header import Header, decode_header, make_header |
| 23 | +from email.headerregistry import HeaderRegistry |
24 | 24 | from email.message import Message
|
25 | 25 | from email.mime.application import MIMEApplication
|
26 | 26 | from email.mime.audio import MIMEAudio
|
27 |
| -from email.mime.text import MIMEText |
28 |
| -from email.mime.image import MIMEImage |
29 | 27 | from email.mime.base import MIMEBase
|
| 28 | +from email.mime.image import MIMEImage |
30 | 29 | from email.mime.message import MIMEMessage
|
31 | 30 | from email.mime.multipart import MIMEMultipart
|
32 | 31 | from email.mime.nonmultipart import MIMENonMultipart
|
33 |
| -from email import utils |
34 |
| -from email import errors |
| 32 | +from email.mime.text import MIMEText |
| 33 | +from email.parser import Parser, HeaderParser |
| 34 | +from email import base64mime |
35 | 35 | from email import encoders
|
| 36 | +from email import errors |
36 | 37 | from email import iterators
|
37 |
| -from email import base64mime |
38 | 38 | from email import quoprimime
|
| 39 | +from email import utils |
39 | 40 |
|
40 | 41 | from test.support import threading_helper
|
41 | 42 | from test.support.os_helper import unlink
|
@@ -5508,7 +5509,12 @@ def test_long_headers_flatten(self):
|
5508 | 5509 | result = fp.getvalue()
|
5509 | 5510 | self._signed_parts_eq(original, result)
|
5510 | 5511 |
|
5511 |
| - |
| 5512 | +class TestHeaderRegistry(TestEmailBase): |
| 5513 | + # See issue gh-93010. |
| 5514 | + def test_HeaderRegistry(self): |
| 5515 | + reg = HeaderRegistry() |
| 5516 | + a = reg('Content-Disposition', 'attachment; 0*00="foo"') |
| 5517 | + self.assertIsInstance(a.defects[0], errors.InvalidHeaderDefect) |
5512 | 5518 |
|
5513 | 5519 | if __name__ == '__main__':
|
5514 | 5520 | unittest.main()
|
0 commit comments