[PyQt] QWebView crashes

Hans-Peter Jansen hpj at urpla.net
Mon Apr 4 15:14:09 BST 2011


On Monday 04 April 2011, 00:23:59 Hans-Peter Jansen wrote:
> On Sunday 03 April 2011, 22:49:44 Gelonida Gmail wrote:
> > Nokia considers this bug not being their problem, but a webkit
> > issue.
> >
> > Therefore I filed a new bug report for webkit.
> >
> > https://bugs.webkit.org/show_bug.cgi?id=57729
>
> Hi Phil,
>
> I was able to simplify the issue even further, and usually just
> clicking on the homepage link on the login page (after logging in)
> crashes in the JS core, but now, this code crashes reliable in the
> webview.show() line over here:
>
> import sys
> import platform
> import PyQt4.QtGui as QtGui
> import PyQt4.QtCore as QtCore
> from PyQt4.QtWebKit import QWebView
>
> print sys.platform, platform.release()
> print QtCore.PYQT_VERSION_STR,QtCore.PYQT_VERSION
>
> app = QtGui.QApplication(sys.argv)
> webview = QWebView()
> urlstr = "http://facebook.com"
> webview.setUrl(QtCore.QUrl(urlstr))
> webview.show()
> sys.exit(app.exec_())

It's getting stranger and stranger:

the crash happens in an interactive python session only. If saved to a 
file, it's running fine (apart from webkits facebook dysfunction, which 
prevents a successful login (for me at least with:
Qt version: 4.7.1
sip version: 4.12.2-snapshot-ec9807971e08
PyQt version: snapshot-4.8.4-8641ecc135b3
Webkit version: 533.3
Python: 2.6 (linux2, 2.6.31.14-6-desktop)
)).

Even more streamlined version:

import sys
from PyQt4 import QtCore, QtGui, QtWebKit

urlstr = "http://facebook.com"

app = QtGui.QApplication(sys.argv)
webview = QtWebKit.QWebView()
webview.setUrl(QtCore.QUrl(urlstr))
webview.show()
sys.exit(app.exec_())


Attached is a slightly improved variant in python and C++, that would be 
interesting to get output and feedback on various platforms and 
versions for (preferably of those, that own a valid facebook 
account..). 

Login successful?
Crash after click on homepage link?

Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webview.cc
Type: text/x-c++src
Size: 699 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110404/5594e1b2/attachment.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: webview.py
Type: application/x-python
Size: 1046 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110404/5594e1b2/attachment.bin>
-------------- next part --------------
CONFIG += qt
SOURCES += webview.cc
TARGET = webview
QT += webkit


More information about the PyQt mailing list