[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-22 Thread STINNER Victor
STINNER Victor added the comment: I'm ok to close this bug :-) > As long as we are restricted by backwards compatibility, it will be hard to > find a hack-free solution. The ideal solution IMO is to re-create > _warnings.filters from scratch when _warnings is reloaded, but such a change >

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-21 Thread Martin Panter
Changes by Martin Panter : -- superseder: Warning -- warnings.filters was modified by test_warnings -> Implement comparison (x==y and x!=y) for _sre.SRE_Pattern ___ Python tracker

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-21 Thread Martin Panter
Martin Panter added the comment: As long as we are restricted by backwards compatibility, it will be hard to find a hack-free solution. The ideal solution IMO is to re-create _warnings.filters from scratch when _warnings is reloaded, but such a change would be safer only for 3.7. So I am

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-21 Thread STINNER Victor
STINNER Victor added the comment: I implemented x==y operator for _sre.SRE_Pattern in Python 3.6 and 3.7, it fixed this issue. For Python 3.5, I removed the warnings.filters test, as we discussed. @Martin Panter: immortal-filters.patch works because I'm not super excited by the change.

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 75b1091594f8 by Victor Stinner in branch '3.5': Issue #28688: Remove warnings.filters check from regrtest https://hg.python.org/cpython/rev/75b1091594f8 New changeset a2616863de06 by Victor Stinner in branch '3.6': Issue #28688: Null merge 3.5

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Here is another way to remember that the filter list has already been initialized. I made a new immortal _warnings.filters_initialized flag at the C level. It is actually a list so that it can be mutated and remembered across module reloads, but it is either

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-18 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file45542/immortal-filters.patch ___ Python tracker ___

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your plan LGTM. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: Ok, let me propose a plan for 3.5, 3.6 and 3.7: * Remove warnings.filters test on Python 3.5 from regrtest * Implement comparison for SRE_Pattern in Python 3.6 and 3.7: issue #28727 I consider that the issue #28727 is a minor enhancement and so is still good

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > The key is based on (action, message, category, module). I think you should > add item[4] (lineno). Oops, right! -- ___ Python tracker

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread Martin Panter
Martin Panter added the comment: I didn’t really like adding the _add_filter() special handling in the first place, but I went ahead because I couldn’t think of a better way to avoid the problem with reloading the warnings modules. So unless anyone can suggest anything better, I am okay with

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: FYI Python 2.7 is not impacted by this bug because it seems like reimporting warnings.py twice gets a new fresh list from _warnings.filters. I don't undertand how/why. -- versions: +Python 3.5, Python 3.6 ___

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > * Fix warnings._add_filter() to implement a custom comparator operator for > regular expression objects: compare pattern and flags Attached patch warnings_key.patch implements this. I really dislike the patch :-( -- keywords: +patch Added file:

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: > * Implement comparision in _sre.SRE_Pattern I wrote a patch and opened the issue #28727: "Implement comparison (x==y and x!=y) for _sre.SRE_Pattern". -- ___ Python tracker

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor
STINNER Victor added the comment: Hum, this issue is a regression caused by the issue #23839. The environment warning was already fixed by the issue #18383 (duplicate: issue #26742): New changeset f57f4e33ba5e by Martin Panter in branch '3.5': Issue #18383: Avoid adding duplicate filters when

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-14 Thread Xiang Zhang
Xiang Zhang added the comment: test___all__ gets the same behaviour. ./python -Werror -m test test___all__ Run tests sequentially 0:00:00 [1/1] test___all__ Warning -- warnings.filters was modified by test___all__ test___all__ failed (env changed) 1 test altered the execution environment:

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-14 Thread STINNER Victor
STINNER Victor added the comment: > How you got this warning? I can't reproduce. Sorry, I forgot to mention that the warning only occurs if you run Python with -Werror: @selma$ ./python -Werror -m test test_warnings Run tests sequentially 0:00:00 [1/1] test_warnings Warning --

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: How you got this warning? I can't reproduce. -- ___ Python tracker ___

[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-14 Thread STINNER Victor
New submission from STINNER Victor: The issue #23839 modified the test runner to always clear caches before running tests. As a side effect, test_warnings started to complain with: Warning -- warnings.filters was modified by test_warnings The issue comes from the following function of