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