Issue 5688: inability to ignore multiline warnings -- request to add re.DOTALL to re.compile (original) (raw)

[forwarded from http://bugs.debian.org/519454]

""" As of now, warnings.py provides only re.I flag to re.compile on warnings.py:160. Recent python-numpy issues way too many warnings, I was trying to filter them out using warnings.filterwarnings, but was unable to filter out multiline warning (numpy.histogram). Adding re.DOTALL to re.I should help to resolve the problem and allow users to match also multiline warning messages. """

I don't really understand this; first, the regex doesn't have to match the entire warning message (and I hope the important things are in the first line, otherwise the warning message is bad) and second, it's always possible to use (.|\n) instead of plain .. Ah yes, third, there are also inline flags: (?s).