From: Federico Caselli Date: Wed, 14 Apr 2021 20:44:28 +0000 (+0200) Subject: Mention how to turn warning to exceptions X-Git-Tag: rel_1_4_11~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55e86dbf507b86995a3505e71af5eff51f160fce;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Mention how to turn warning to exceptions This helps locating the offending code, since the reported warning location is not always correct. References: #6241 Change-Id: I85d3a20e5b428a5003b541b36b9a77f1d7c1acb6 --- diff --git a/doc/build/changelog/migration_20.rst b/doc/build/changelog/migration_20.rst index 6e349c8e83..765a418e48 100644 --- a/doc/build/changelog/migration_20.rst +++ b/doc/build/changelog/migration_20.rst @@ -177,6 +177,11 @@ suppress any warnings is selected:: SQLALCHEMY_WARN_20=1 python -W always::DeprecationWarning test3.py +Since the reported warning location is not always in the correct place, locating +the offending code may be difficult without the full stacktrace. This can be achieved +by transforming the warnings to exceptions by specifying the ``error`` warning filter, +using Python option ``-W error::DeprecationWarning``. + .. _warnings filter: https://docs.python.org/3/library/warnings.html#the-warnings-filter With warnings turned on, our program now has a lot to say::