File tree 1 file changed +8
-6
lines changed 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1517,14 +1517,16 @@ def get_obs_local_part(value):
1517
1517
obs_local_part .defects .append (errors .InvalidHeaderDefect (
1518
1518
"abandoned parse; truncated value?" ))
1519
1519
else :
1520
- if (obs_local_part [0 ].token_type == 'dot' or
1521
- obs_local_part [0 ].token_type == 'cfws' and
1522
- obs_local_part [1 ].token_type == 'dot' ):
1520
+ if (obs_local_part [0 ].token_type == 'dot'
1521
+ or (obs_local_part [0 ].token_type == 'cfws'
1522
+ and len (obs_local_part ) == 1
1523
+ or obs_local_part [1 ].token_type == 'dot' )):
1523
1524
obs_local_part .defects .append (errors .InvalidHeaderDefect (
1524
1525
"Invalid leading '.' in local part" ))
1525
- if (obs_local_part [- 1 ].token_type == 'dot' or
1526
- obs_local_part [- 1 ].token_type == 'cfws' and
1527
- obs_local_part [- 2 ].token_type == 'dot' ):
1526
+ if (obs_local_part [- 1 ].token_type == 'dot'
1527
+ or (obs_local_part [- 1 ].token_type == 'cfws'
1528
+ and len (obs_local_part ) == 1
1529
+ or obs_local_part [- 2 ].token_type == 'dot' )):
1528
1530
obs_local_part .defects .append (errors .InvalidHeaderDefect (
1529
1531
"Invalid trailing '.' in local part" ))
1530
1532
if obs_local_part .defects :
You can’t perform that action at this time.
0 commit comments