python -W

MRAB python at mrabarnett.plus.com
Tue Jul 12 15:05:32 EDT 2022


On 12/07/2022 18:39, אורי wrote:
> Is `python -W all` and `python -Wa` the same? And what are the options
> for  `python -W`? I didn't find it documented. For example, I'm using
> `python -W error::DeprecationWarning` and I didn't see it documented on
> https://docs.python.org/3/using/cmdline.html
> 
> Is there a way to convert all warnings to exceptions and how?
> 
It's documented on that page.

It says """The action names can be abbreviated as desired and the 
interpreter will resolve them to the appropriate action name. For 
example, -Wi is the same as -Wignore."", so "python -Wa" is the same as 
"python -Walways".

It also says """-Werror    # Convert to exceptions""", so "python 
-Werror" (or "python -We") will convert all warnings to exceptions.


More information about the Python-list mailing list