-W: Python bug? Documentation bug?

Clarence clarence1126 at gmail.com
Tue Dec 12 20:43:56 EST 2006


Clarence wrote:
> It appears that the -W option on starting python doesn't work the same
> as the warnings module. In particular, the "message" parameter is not
> treated as a regular expression, but rather a string literal which must
> appear at the beginning of a warning message in order to match. The

I must have gotten confused during my testing. The behavior is the same
whether coming from the command line or from within the program.
However, I see that the regular expression is being tested using
re.match rather than re.search. Does that seem correct to people? At
the least, that should be mentioned in the documentation.




More information about the Python-list mailing list