File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2404,13 +2404,12 @@ def get_section(value):
24042404 value ))
24052405 section .append (ValueTerminal ('*' , 'section-marker' ))
24062406 value = value [1 :]
2407- # We don't use str.isdigit because only 0-9 are accepted, not super-script
2408- # and other types of digits.
2409- if not value or not '0' <= value [0 ] <= '9' :
2407+ # We don't use str.isdigit because only ASCII digits are allowed.
2408+ if not value or not ('0' <= value [0 ] <= '9' ):
24102409 raise errors .HeaderParseError ("Expected section number but "
24112410 "found {}" .format (value ))
24122411 digits = ''
2413- while value and '0' <= value [0 ] <= '9' :
2412+ while value and ( '0' <= value [0 ] <= '9' ) :
24142413 digits += value [0 ]
24152414 value = value [1 :]
24162415 if digits [0 ] == '0' and digits != '0' :
Original file line number Diff line number Diff line change @@ -2983,8 +2983,7 @@ def mime_parameters_as_value(self,
29832983 [('r' , '"' )],
29842984 [errors .InvalidHeaderDefect ]* 2 ),
29852985
2986- # gh-87112: Unicode super-script digits (and others) are not allowed
2987- # as section numbers.
2986+ # gh-87112: Only ASCII digits can be section numbers.
29882987 'non_allowed_digits' : (
29892988 'foo*0=bar; foo*²=baz' ,
29902989 ' foo="bar"' ,
You can’t perform that action at this time.
0 commit comments