File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1480,11 +1480,6 @@ def get_local_part(value):
14801480 local_part .defects .append (errors .ObsoleteHeaderDefect (
14811481 "local-part is not a dot-atom (contains CFWS)" ))
14821482 local_part [0 ] = obs_local_part
1483- try :
1484- local_part .value .encode ('ascii' )
1485- except UnicodeEncodeError :
1486- local_part .defects .append (errors .NonASCIILocalPartDefect (
1487- "local-part contains non-ASCII characters)" ))
14881483 return local_part , value
14891484
14901485def get_obs_local_part (value ):
Original file line number Diff line number Diff line change @@ -104,10 +104,5 @@ def __str__(self):
104104class ObsoleteHeaderDefect (HeaderDefect ):
105105 """Header uses syntax declared obsolete by RFC 5322"""
106106
107- class NonASCIILocalPartDefect (HeaderDefect ):
108- """local_part contains non-ASCII characters"""
109- # This defect only occurs during unicode parsing, not when
110- # parsing messages decoded from binary.
111-
112107class InvalidDateDefect (HeaderDefect ):
113108 """Header has unparsable or invalid date"""
Original file line number Diff line number Diff line change @@ -1214,14 +1214,14 @@ def test_get_local_part_valid_and_invalid_qp_in_atom_list(self):
12141214 '@example.com' )
12151215 self .assertEqual (local_part .local_part , r'\example\\ example' )
12161216
1217- def test_get_local_part_unicode_defect (self ):
1217+ def test_get_local_part_unicode (self ):
12181218 # Currently this only happens when parsing unicode, not when parsing
12191219 # stuff that was originally binary.
12201220 local_part = self ._test_get_x (parser .get_local_part ,
12211221 'exámple@example.com' ,
12221222 'exámple' ,
12231223 'exámple' ,
1224- [errors . NonASCIILocalPartDefect ],
1224+ [],
12251225 '@example.com' )
12261226 self .assertEqual (local_part .local_part , 'exámple' )
12271227
You can’t perform that action at this time.
0 commit comments