bpo-31677: email: Remove re.IGNORECASE flag (GH-3868) · python/cpython@bf477a9

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -36,11 +36,11 @@

3636

=\? # literal =?

3737

(?P<charset>[^?]*?) # non-greedy up to the next ? is the charset

3838

\? # literal ?

39-

(?P<encoding>[qb]) # either a "q" or a "b", case insensitive

39+

(?P<encoding>[qQbB]) # either a "q" or a "b", case insensitive

4040

\? # literal ?

4141

(?P<encoded>.*?) # non-greedy up to the next ?= is the encoded string

4242

\?= # literal ?=

43-

''', re.VERBOSE | re.IGNORECASE | re.MULTILINE)

43+

''', re.VERBOSE | re.MULTILINE)

4444
4545

# Field name regexp, including trailing colon, but not separating whitespace,

4646

# according to RFC 2822. Character range is from tilde to exclamation mark.

Original file line numberDiff line numberDiff line change

@@ -114,18 +114,6 @@ def getaddresses(fieldvalues):

114114

return a.addresslist

115115
116116
117-
118-

ecre = re.compile(r'''

119-

=\? # literal =?

120-

(?P<charset>[^?]*?) # non-greedy up to the next ? is the charset

121-

\? # literal ?

122-

(?P<encoding>[qb]) # either a "q" or a "b", case insensitive

123-

\? # literal ?

124-

(?P<atom>.*?) # non-greedy up to the next ?= is the atom

125-

\?= # literal ?=

126-

''', re.VERBOSE | re.IGNORECASE)

127-
128-
129117

def _format_timetuple_and_zone(timetuple, zone):

130118

return '%s, %02d %s %04d %02d:%02d:%02d %s' % (

131119

['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][timetuple[6]],