Bug 1008392 - [abrt] Mayavi-4.3.0-2.fc19: pygments_highlighter.py:148:highlightBlock:AttributeError: 'QTextBlockUserData' object has no attribute 'syntax_stack'
[abrt] Mayavi-4.3.0-2.fc19: pygments_highlighter.py:148:highlightBlock:Attrib...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: Mayavi (Show other bugs)
19
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Orion Poplawski
Fedora Extras Quality Assurance
abrt_hash:7e50eda366cf81b8356d15f7458...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-16 06:04 EDT by Benny
Modified: 2013-10-22 13:03 EDT (History)
2 users (show)

See Also:
Fixed In Version: python-pyface-4.3.0-4.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-29 20:46:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: backtrace (806 bytes, text/plain)
2013-09-16 06:04 EDT, Benny
no flags Details
File: environ (1.37 KB, text/plain)
2013-09-16 06:04 EDT, Benny
no flags Details

  None (edit)
Description Benny 2013-09-16 06:04:15 EDT
Description of problem:
Startup Mayavi --> This error

Version-Release number of selected component:
Mayavi-4.3.0-2.fc19

Additional info:
reporter:       libreport-2.1.7
cmdline:        /usr/bin/python /usr/bin/mayavi2
dso_list:       python-pyface-4.3.0-2.fc19.noarch
executable:     /usr/bin/mayavi2
kernel:         3.10.11-200.fc19.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
pygments_highlighter.py:148:highlightBlock:AttributeError: 'QTextBlockUserData' object has no attribute 'syntax_stack'

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pyface/ui/qt4/python_shell.py", line 492, in highlightBlock
    super(PythonWidgetHighlighter, self).highlightBlock(string)
  File "/usr/lib/python2.7/site-packages/pyface/ui/qt4/code_editor/pygments_highlighter.py", line 148, in highlightBlock
    self._lexer._epd_state_stack = prev_data.syntax_stack
AttributeError: 'QTextBlockUserData' object has no attribute 'syntax_stack'

Local variables in innermost frame:
self: <pyface.ui.qt4.python_shell.PythonWidgetHighlighter object at 0x5076320>
prev_data: <PyQt4.QtGui.QTextBlockUserData object at 0x5999d40>
qstring: u'Please check the log file for details.'
Comment 1 Benny 2013-09-16 06:04:23 EDT
Created attachment 798198 [details]
File: backtrace
Comment 2 Benny 2013-09-16 06:04:25 EDT
Created attachment 798199 [details]
File: environ
Comment 3 Orion Poplawski 2013-09-16 12:43:03 EDT
Try installing wxPython.  The problem seems to be that Mayavi doesn't work well with the pyface Qt backend.  I hope to have some updates out soon to fix this, but installing wxPython should do the trick.
Comment 4 Benny 2013-09-17 03:43:36 EDT
Installing wxPython fixed the problem. Thanks!
Maybe wxPython should be added to the dependency list?
Comment 5 Fedora Update System 2013-09-17 12:08:24 EDT
python-pyface-4.3.0-4.fc19, Mayavi-4.3.0-6.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-pyface-4.3.0-4.fc19,Mayavi-4.3.0-6.fc19
Comment 6 Benny 2013-09-18 03:36:35 EDT
To test this I need python-pyface-wx and python-pyface-qt (as is stated). 

Additionally, when I run a script like this: 
#!/usr/bin/env python
import sys 
import numpy as np
fname=sys.argv[1]
x,y,z,nnn=np.loadtxt(fname,delimiter=';',usecols=(1,2,3,4),unpack=True)
from mayavi import mlab
mlab.options.offscreen=True
mlab.figure(1,fgcolor=(0,0,0),bgcolor=(1,1,1),size=(1280,1024))
pts=mlab.points3d(x,y,z,nnn,scale_mode='none',scale_factor=0.0,colormap='jet',vmin=3.0,vmax=8.0)
mesh=mlab.pipeline.delaunay2d(pts)
mlab.pipeline.surface(mesh,representation='wireframe',line_width=1.333,colormap='jet',vmin=3.0,vmax=8.0)
mlab.view(elevation=30,azimuth=-90)
mlab.savefig('dl-'+fname.rsplit(".",1)[0]+'.png')

I obtain this error:
QWidget: Must construct a QApplication before a QPaintDevice
Aborted (core dumped)

(maybe this helps https://mail.enthought.com/pipermail/enthought-dev/2012-March/030750.html )

Is this related to this bug or should I file a new one?
Comment 7 Fedora Update System 2013-09-18 09:00:41 EDT
Package python-pyface-4.3.0-4.fc19, Mayavi-4.3.0-6.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-pyface-4.3.0-4.fc19 Mayavi-4.3.0-6.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17000/python-pyface-4.3.0-4.fc19,Mayavi-4.3.0-6.fc19
then log in and leave karma (feedback).
Comment 8 Orion Poplawski 2013-09-18 11:32:12 EDT
I think that is a separate issue.  pyface is loading the wx toolkit as expected, but something else is going awry.

Looks like this fixes it: https://github.com/enthought/mayavi/pull/64/files

Try that and let me know if you run into any other problems.
Comment 9 Benny 2013-09-19 03:36:01 EDT
Everything seems to work for now :) 

I updated to the newer version and added the fix in "https://github.com/enthought/mayavi/pull/64/files" and that seems to work like charm.

Much obliged.
Comment 10 Fedora Update System 2013-09-21 04:32:54 EDT
Package python-pyface-4.3.0-4.fc19, Mayavi-4.3.0-7.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-pyface-4.3.0-4.fc19 Mayavi-4.3.0-7.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-17000/python-pyface-4.3.0-4.fc19,Mayavi-4.3.0-7.fc19
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2013-09-29 20:46:29 EDT
python-pyface-4.3.0-4.fc19, Mayavi-4.3.0-7.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Andre F. 2013-10-21 16:16:12 EDT
I've still have the same problem with:

Python 2.7.5 (default, Oct  8 2013, 12:19:40) 
[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mayavi import mlab
QWidget: Must construct a QApplication before a QPaintDevice
Aborted (core dumped)

Linux 3.11.4-201.fc19.x86_64


(In reply to Benny from comment #6)
> To test this I need python-pyface-wx and python-pyface-qt (as is stated). 
> 
> Additionally, when I run a script like this: 
> #!/usr/bin/env python
> import sys 
> import numpy as np
> fname=sys.argv[1]
> x,y,z,nnn=np.loadtxt(fname,delimiter=';',usecols=(1,2,3,4),unpack=True)
> from mayavi import mlab
> mlab.options.offscreen=True
> mlab.figure(1,fgcolor=(0,0,0),bgcolor=(1,1,1),size=(1280,1024))
> pts=mlab.points3d(x,y,z,nnn,scale_mode='none',scale_factor=0.0,
> colormap='jet',vmin=3.0,vmax=8.0)
> mesh=mlab.pipeline.delaunay2d(pts)
> mlab.pipeline.surface(mesh,representation='wireframe',line_width=1.333,
> colormap='jet',vmin=3.0,vmax=8.0)
> mlab.view(elevation=30,azimuth=-90)
> mlab.savefig('dl-'+fname.rsplit(".",1)[0]+'.png')
> 
> I obtain this error:
> QWidget: Must construct a QApplication before a QPaintDevice
> Aborted (core dumped)
> 
> (maybe this helps
> https://mail.enthought.com/pipermail/enthought-dev/2012-March/030750.html )
> 
> Is this related to this bug or should I file a new one?
Comment 13 Orion Poplawski 2013-10-22 00:32:35 EDT
(In reply to Andre F. from comment #12)
> I've still have the same problem with:
> 
> Python 2.7.5 (default, Oct  8 2013, 12:19:40) 
> [GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from mayavi import mlab
> QWidget: Must construct a QApplication before a QPaintDevice
> Aborted (core dumped)

What version of Mayavi and python-pyface do you have?
Comment 14 Andre F. 2013-10-22 08:33:44 EDT
There it goes.

[andre@dell1555fedora ~]$ rpm -q python-pyface
python-pyface-4.3.0-4.fc19.noarch
[andre@dell1555fedora ~]$ rpm -q Mayavi
Mayavi-4.3.0-7.fc19.x86_64

Any more info needed?
Comment 15 Andre F. 2013-10-22 13:03:52 EDT
Forget what about my bug, I had another installation of mayavi in my site-packages mayavi-4.3.0-py2.7-linux-x86_64.egg .... Really sorry I mixed easy_install with yum install. Just removed it everything working fine.

Note You need to log in before you can comment on or make changes to this bug.