bpo-31677: email: Add re.ASCII when re.IGNORECASE is used by methane · Pull Request #3868 · python/cpython

Conversation

@methane

While there is not real bug in this case, using re.ASCII is
safe when re.IGNORECASE is used.

This commit removes dead copy in email.util too.

https://bugs.python.org/issue31677

While there is not real bug in this case, using re.ASCII is
safe when re.IGNORECASE is used.

This commit removes dead copy in email.util too.

warsaw

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for removing the dead code too.

bitdancer

\? # literal ?
(?P<atom>.*?) # non-greedy up to the next ?= is the atom
\?= # literal ?=
''', re.VERBOSE | re.IGNORECASE)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably left in place for backward compatibility reasons (just in case someone was using it). Or it may have been overlooked. No way to tell :) But, probably better to not delete it if you backport this change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this change doesn't actual bugfix (B and Q don't have another lower cases),
I won't backport it to Python 3.6.

Labels