Closed
Description
Long story short
Warnings have useless frame/position information.
Expected behaviour
Warnings should point to my code so I know what to fix.
Actual behaviour
Warnings point to aiohttp’s lines where the warnings are raised (like aiohttp/helpers.py:129: DeprecationWarning: ClientSession.close() is a coroutine) which makes them rather useless. That’s because warnings.warn is called with the default stacklevel value of 1. It’s a rather unknown option but makes the warnings incredibly more useful. :) See also: https://docs.python.org/3/library/warnings.html#warnings.warn for an example.