[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-11-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5e8ef1493843 by Victor Stinner in branch '3.6': Implement rich comparison for _sre.SRE_Pattern https://hg.python.org/cpython/rev/5e8ef1493843 -- ___ Python tracker

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-26 Thread STINNER Victor
STINNER Victor added the comment: Note: My issue #26742 has been marked as a duplicate of this one. I confirm that "./python -Wd -m test -j0 test_warnings" doesn't complain "1 test altered the execution environment: test_warnings" anymore. Thanks for the fix. --

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-26 Thread Martin Panter
Martin Panter added the comment: I eliminated initial_len from my final version. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset f57f4e33ba5e by Martin Panter in branch '3.5': Issue #18383: Avoid adding duplicate filters when warnings is reloaded https://hg.python.org/cpython/rev/f57f4e33ba5e New changeset 90bb91be6f3b by Martin Panter in branch 'default': Issue #18383:

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM, except that initial_len is now always 0. -- ___ Python tracker ___

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-25 Thread Martin Panter
Martin Panter added the comment: New patch with common _add_filters() function, and added resetwarnings() calls to avoid the conflict with pre-defined filters. -- Added file: http://bugs.python.org/file43005/issue18383_avoid_dups_4.diff ___ Python

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ ./python -We::UserWarning -m test.regrtest test_warnings Run tests sequentially 0:00:00 [1/1] test_warnings /home/serhiy/py/cpython/Lib/test/test_warnings/__init__.py:108: UserWarning: FilterTests.test_ignore_after_default self.module.warn(message,

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-22 Thread Berker Peksag
Berker Peksag added the comment: LGTM -- stage: patch review -> commit review ___ Python tracker ___ ___

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-21 Thread Martin Panter
Martin Panter added the comment: Forgot to refresh my patch -- Added file: http://bugs.python.org/file42938/issue18383_avoid_dups_3.diff ___ Python tracker

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-21 Thread Martin Panter
Changes by Martin Panter : Removed file: http://bugs.python.org/file42937/issue18383_avoid_dups_3.diff ___ Python tracker ___

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2016-05-21 Thread Martin Panter
Martin Panter added the comment: I am inclined to go with Alex’s patch. I am uploading a new version of it, issue18383_avoid_dups_3.diff, which resolves conflicts with recent changes. -- versions: -Python 3.4 Added file: http://bugs.python.org/file42937/issue18383_avoid_dups_3.diff

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2015-09-02 Thread STINNER Victor
STINNER Victor added the comment: > Revision c1396d28c440 looks like it may help. Possibly with the 3.5+ > assertWarns() half of the problem; I’ll have to have a closer look later. Oh, I wasn't aware of this issue. Good to know that I contributed to it :-) -- nosy: +haypo

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2015-09-02 Thread Martin Panter
Martin Panter added the comment: Okay so I take back my first proposal of restoring the filters in the test suite, which would bring us back to . Also, my second proposal of setting a flag doesn’t look so easy either. The “_warnings” C module

[issue18383] test_warnings modifies warnings.filters when running with "-W default"

2015-09-02 Thread Martin Panter
Martin Panter added the comment: Revision c1396d28c440 looks like it may help. Possibly with the 3.5+ assertWarns() half of the problem; I’ll have to have a closer look later. -- ___ Python tracker

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-25 Thread Martin Panter
Martin Panter added the comment: Florent’s manual reproducer is fixed by issue18383_34_2.diff, as is test___all__. And I think the new logic for changing the priority of the filter entries might be sound now. But it does seem like we are adding unnecessary complexity to the implementation

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-14 Thread Alex Shkop
Alex Shkop added the comment: This is updated patch that doesn't alter warn_explicit behavior. So the following: simplefilter(ignore) simplefilter(error, append=True) simplefilter(ignore, append=True) will ignore all warnings with this patch and no duplicates are inserted to warnings.filters.

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-13 Thread Alex Shkop
Alex Shkop added the comment: @rbcollins that is exactly what was trying to say in previous comment. We can make a change to current patch that won't affect behavior. In old API in this sequence of filters last filter was never used: simplefilter(ignore) simplefilter(error, append=True)

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-08-12 Thread Robert Collins
Robert Collins added the comment: @ashkop so append=True could be clearer as 'atend=True' - both forms of call are expected to add the filter, but one adds to the front, one to the end. Looking at warn_explicit, its takes the first matching filter, and then acts on its action. So the

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-07-31 Thread Alex Shkop
Alex Shkop added the comment: Looking at this patch again, I'm wondering if it is correct to remove duplicate filter if append=True. Perhaps in this case it is more correct to leave the filter in place and do not append new one? -- ___ Python

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-07-30 Thread Berker Peksag
Berker Peksag added the comment: Here is an updated patch (against 3.4 branch). I've just made some small cosmetic changes and split the test into two parts (filterwarnings and simplefilter). Patch looks reasonable to me, but it would be nice to get a second opinion. -- Added file:

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-06-18 Thread Martin Panter
Martin Panter added the comment: FWIW there is a new message currently being triggered by test___all__. The patch here also stops this message. $ hg update 4335d898be59 $ ./python -bWall -m test test___all__ [1/1] test___all__ Warning -- warnings.filters was modified by test___all__ 1 test

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-05-12 Thread Alex Shkop
Alex Shkop added the comment: Please, review the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___ ___ Python-bugs-list mailing

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-28 Thread Alex Shkop
Alex Shkop added the comment: *ping* -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-14 Thread Alex Shkop
Alex Shkop added the comment: Removed unnecessary assertWarns() contexts and fixed spelling errors. -- Added file: http://bugs.python.org/file38982/issue18383_assert_warns_and_dups_v2.patch ___ Python tracker rep...@bugs.python.org

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-11 Thread Martin Panter
Martin Panter added the comment: issue18383_assert_warns_and_dups.patch fixes all my new test suite complaints, and removes the message about altering warnings.filters. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-09 Thread Martin Panter
Martin Panter added the comment: I tried issue18383_remove_dups_and_test.patch, but it doesn’t seem to fix the problem, and causes new test failures and warnings. Let me know if you want more info. Existing messages that I thought this was meant to fix: [372/393/5] test_warnings

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-09 Thread Alex Shkop
Alex Shkop added the comment: So, there are actually two issues, both of them causing the original warning. First issue was pointed out by Florent Xicluna. warnings.filterwarnings() method can create duplicates in warnings.filters. Second issue is that assertWarns() works incorrectly in

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-06 Thread Alex Shkop
Alex Shkop added the comment: When caller adds duplicate filter maybe we should promote his filter to the beginning of filters list? This feels more correct to me. So if user adds duplicate filter everything will work as if we added it. -- Added file:

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-04 Thread Berker Peksag
Berker Peksag added the comment: issue18383_remove_dups.patch looks good to me. A test would be nice. -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - berker.peksag stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-04-04 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___ ___ Python-bugs-list

[issue18383] test_warnings modifies warnings.filters when running with -W default

2015-03-02 Thread Alex Shkop
Alex Shkop added the comment: The issue occurs only if C implementation of _warnings is available. It is caused by re-use of global filters variable from _warnings when warnings is being re-imported. So warnings modifies _warnings.filters on first import. Then, when you import warnings again

[issue18383] test_warnings modifies warnings.filters when running with -W default

2014-12-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch fixes symptoms. It would be better to fix the cause of the issue -- warnings.filters shouldn't duplicate after module reloading. -- nosy: +serhiy.storchaka versions: +Python 3.5 -Python 3.3 ___ Python

[issue18383] test_warnings modifies warnings.filters when running with -W default

2013-08-06 Thread Ezio Melotti
Ezio Melotti added the comment: LGTM -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18383] test_warnings modifies warnings.filters when running with -W default

2013-07-12 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18383 ___ ___ Python-bugs-list

[issue18383] test_warnings modifies warnings.filters when running with -W default

2013-07-06 Thread Florent Xicluna
New submission from Florent Xicluna: Running the test suite with -Wd, we got the warning: [247/375] test_warnings Warning -- warnings.filters was modified by test_warnings This is how to reproduce: ./python -Wd import warnings from test import support saved = warnings.filters.copy()

[issue18383] test_warnings modifies warnings.filters when running with -W default

2013-07-06 Thread Florent Xicluna
Florent Xicluna added the comment: Much simpler: $ ./python -Wd import warnings import sys saved = warnings.filters.copy() del sys.modules['warnings'] import warnings assert warnings.filters != saved assert warnings.filters.pop(0) = warnings.filters[0] assert warnings.filters == saved

[issue18383] test_warnings modifies warnings.filters when running with -W default

2013-07-06 Thread Florent Xicluna
Florent Xicluna added the comment: This patch fixes the issue. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file30817/issue18383_test_warnings_filters.diff ___ Python tracker rep...@bugs.python.org