• python -W

    From =?UTF-8?B?15DXldeo15k=?=@21:1/5 to All on Tue Jul 12 20:39:29 2022
    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?

    Thanks,
    אורי
    uri@speedy.net

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MRAB@21:1/5 to All on Tue Jul 12 20:05:32 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?15DXldeo15k=?=@21:1/5 to python@mrabarnett.plus.com on Wed Jul 13 02:04:41 2022
    Thank you.
    אורי
    uri@speedy.net


    On Tue, Jul 12, 2022 at 10:09 PM MRAB <python@mrabarnett.plus.com> wrote:

    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.
    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)