Jorge Scandaliaris <jorgesmbox-ml@...> writes: > > Hi, > I just mentioned this problem with Qt4Agg and python 3.4 in another thread > [1], but I decided to post it on a thread of its own, as I suspect it might > be a bug in the Qt4Agg backend. > > I get a NameError exception (see backtrace below) when trying to use key > events in matplotlib (master branch rev: > e322d5f5bb024bbec44d3ba76da1bc16bf52af9c), python 3.4.1, and pyqt 4.10. > Is this a bug? >
A trivial fix using six (credits to Werner for suggesting it), also submitted as issue #3117 in the GH tracker: diff --git a/lib/matplotlib/backends/backend_qt4.py b/lib/matplotlib/backends/backend_qt4.py index 70152aa..26486b4 100644 --- a/lib/matplotlib/backends/backend_qt4.py +++ b/lib/matplotlib/backends/backend_qt4.py @@ -362,7 +362,7 @@ class FigureCanvasQT(QtGui.QWidget, FigureCanvasBase): if event_key > MAX_UNICODE: return None - key = unichr(event_key) + key = six.unichr(event_key) # qt delivers capitalized letters. fix capitalization # note that capslock is ignored if 'shift' in mods: ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users