enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

Deprecation warnings under Python 3.6 + wxPython 4.0.1 backend running the demo example #416

Open mprogram opened 5 years ago

mprogram commented 5 years ago

https://docs.enthought.com/mayavi/mayavi/mlab.html

$ env QT_API=pyside2 ETS_TOOLKIT=wx idle-python3.6
14:29:56: Debug: Adding duplicate image handler for 'Windows bitmap file'
14:29:56: Debug: Adding duplicate image handler for 'Windows bitmap file'
14:29:58: Debug: Unsupported OpenGL attribute 32

in IDLE:

Python 3.6.8 (default, Jan 14 2019, 11:02:34) 
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
======================= RESTART: ~/demo.py =======================

Warning (from warnings module):
  File "/usr/lib/python3/dist-packages/pyface/ui/wx/clipboard.py", line 25
    PythonObjectFormat = wx.CustomDataFormat('PythonObject')
wxPyDeprecationWarning: Call to deprecated item. Use wx.DataFormat instead.

Warning (from warnings module):
  File "/usr/lib/python3/dist-packages/pyface/wx/drag_and_drop.py", line 99
    PythonObject = wx.CustomDataFormat('PythonObject')
wxPyDeprecationWarning: Call to deprecated item. Use wx.DataFormat instead.

Warning (from warnings module):
  File "/usr/lib/python3/dist-packages/pyface/ui/wx/action/action_item.py", line 378
    self.control_id, label, bmp, wx.NullBitmap, kind, tooltip, longtip, None
wxPyDeprecationWarning: Call to deprecated item. Use :meth:`AddTool` instead.

Warning (from warnings module):
  File "/usr/lib/python3/dist-packages/pyface/ui/wx/action/action_item.py", line 396
    wx.EVT_TOOL(parent, self.control_id, self._on_tool)
wxPyDeprecationWarning: Call to deprecated item __call__. Use :meth:`EvtHandler.Bind` instead.

Warning (from warnings module):
  File "/usr/lib/python3/dist-packages/pyface/ui/wx/window.py", line 198
    self._position = event.GetEventObject().GetPositionTuple()
wxPyDeprecationWarning: Call to deprecated item. Use GetPosition instead
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pyface/ui/wx/window.py", line 198, in _wx_on_control_move
    self._position = event.GetEventObject().GetPositionTuple()
  File "/usr/lib/python3/dist-packages/traits/trait_handlers.py", line 236, in error
    object, name, self.full_info(object, name, value), value
traits.trait_errors.TraitError: The '_position' trait of a MayaviViewer instance must be a tuple of the form: (a value of class 'int', a value of class 'int'), but a value of wx.Point(900, 730) <class 'wx._core.Point'> was specified.

=============================== RESTART: Shell ===============================
>>> 

also enthought/traits/issues/497

mprogram commented 5 years ago

Does the backend matter? I'm getting a non-tiled mesh under QT_API=pyqt5 ETS_TOOLKIT=qt, whereas under wx (works with Python 3 only, and may or may not crash silently with Python 2, see below) or under QT_API=pyqt ETS_TOOLKIT=qt4 it is both, meshed and tiled.

Jul 06 23:40:05 linux kernel: python2.7[8735]: segfault at f0 ip 00007f122e3c6452 sp 00007ffeaa7e95f8 error 4 in libgdk-3.so.0.2404.4[7f122e3a7000+79000] (= 3.24.8-1ubuntu1)

EDIT: Actually, I cannot close the preference window in Mayavi2 under the wx backend. If I change the default behaviour in traitsui/wx/file_editor.py:125, then yes.

mprogram commented 5 years ago

I see the warnings are being related to #288, also #287 for a similar PR and some discussion.