[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-07-18 Thread Gerrit Holl
Gerrit Holl added the comment: I get bitten by this frequently, and find myself patching many libraries just to avoid them from calling .catch_warnings. Does anyone know whether to fix this it would suffice to edit warnings.py, or would I need to dig into _warnings.c as well? --

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-02-28 Thread Gerrit Holl
Gerrit Holl added the comment: To resolve this, the `catch_warnings` context manager upon exiting should not only reset `filters`, but also `_filters_version`, and perhaps an associated dictionary? Not sure if I'm understanding the code in `warnings.c` correctly, and whether, for this change,

[issue29672] `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted

2017-02-28 Thread Gerrit Holl
Changes by Gerrit Holl : -- title: `catch_warnings` context manager causes warnings to be reprinted -> `catch_warnings` context manager should reset warning registry to previous state upon exiting, to prevent warnings from being reprinted ___ Python