[PyQt] Easy Segfault using (or misusing) QTextStream

David Cortesi davecortesi at gmail.com
Sun Aug 11 20:50:33 BST 2013

I was experimenting to see if I could make an in-memory QTextStream and
discovered instead an easy way to make Python 2.7.3 segfault:

[08:23] python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtCore import (Qt, QString, QTextStream)
>>> ts = QTextStream(QString())
>>> ts << u'x'
Segmentation fault

The above is on OSX 10.6, but exactly the same result happens in Ubuntu 12.

It's probably mis-use of the QTextStream (*can* one build a text stream in
memory, rewind it and read it back?) but cratering the interpreter seems a
bit harsh...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20130811/b93bd9e0/attachment.html>

More information about the PyQt mailing list