New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings enabled inappropriately #902

Closed
efahl opened this Issue Jun 27, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@efahl
Copy link

efahl commented Jun 27, 2018

Operating system: Win 10 64
wxPython version: 4.0.2 and 4.0.3, stock, pip installed.
Python version: CPython 3.6.5, stock.

In wx/lib/plot/polyobjects.py at line 40 there is a line that re-enables warnings with sort of a shotgun approach:

warnings.simplefilter('default')

This causes a bunch of regressions in our Py 3 tests, with various stdlib or PyPI modules now producing deprecation warnings. Maybe it should be a bit more surgical in its targeting, like the one in core.py (or should this even be there???).

warnings.simplefilter('default', wxPyDeprecationWarning)

Here's any easy test:

python -c 'import imp ; print("nothing")'
nothing
python -c 'import wx.lib.plot ; import imp'
-c:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jun 28, 2018

It looks like the wx.lib.plot code is using the stock PendingDeprecationWarning instead of wxPyDeprecationWarning, so probably a better fix would be to derive a new class from PendingDeprecationWarning, update the plot modules to use it, and then set the filter using that one.

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jun 28, 2018

Or just switch it to use wxPyDeprecationWarning

@RobinD42

This comment has been minimized.

Copy link
Member

RobinD42 commented Jul 4, 2018

Fixed by #911

@RobinD42 RobinD42 closed this Jul 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment