We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4036f8 commit b8fc5f4Copy full SHA for b8fc5f4
Lib/test/test_email/test_headerregistry.py
@@ -247,8 +247,11 @@ def content_type_as_value(self,
247
decoded = args[2] if l>2 and args[2] is not DITTO else source
248
header = 'Content-Type:' + ' ' if source else ''
249
folded = args[3] if l>3 else header + decoded + '\n'
250
- # Suppress deprecation warning for rfc2231_nonascii_in_charset_of_charset_parameter_value
251
- if 'utf-8%E2%80%9D' in source and not 'ascii' in source:
+ # Both rfc2231 test cases with utf-8%E2%80%9D raise warnings,
+ # clear encoding cache to ensure test isolation.
252
+ if 'utf-8%E2%80%9D' in source:
253
+ import encodings
254
+ encodings._cache.clear()
255
with self.assertWarns(DeprecationWarning):
256
h = self.make_header('Content-Type', source)
257
else:
0 commit comments