This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients martin.panter, serhiy.storchaka, vstinner, xiang.zhang
Date 2016-11-17.15:30:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479396653.23.0.155218106914.issue28688@psf.upfronthosting.co.za>
In-reply-to
Content
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 warnings is reloaded
https://hg.python.org/cpython/rev/f57f4e33ba5e

The problem is that _sre.SRE_Pattern doesn't import rich compare: so two patterns are only equal if it's exactly the same object... which is likely when re caches the compiled expression... But the Python test runner now starts by clearing the re cache!

I see different options:

* Find something else to not re-initialize warning filters, "_processoptions(sys.warnoptions)" in warnings.py.
* Fix warnings._add_filter() to implement a custom comparator operator for regular expression objects: compare pattern and flags
* Implement comparision in _sre.SRE_Pattern
History
Date User Action Args
2016-11-17 15:30:53vstinnersetrecipients: + vstinner, martin.panter, serhiy.storchaka, xiang.zhang
2016-11-17 15:30:53vstinnersetmessageid: <1479396653.23.0.155218106914.issue28688@psf.upfronthosting.co.za>
2016-11-17 15:30:53vstinnerlinkissue28688 messages
2016-11-17 15:30:53vstinnercreate