[PyQt] Reading from empty QDataStream crashes

Phil Thompson phil at riverbankcomputing.com
Wed Apr 9 18:33:50 BST 2008


On Wednesday 09 April 2008, İsmail Dönmez wrote:
> Hi all,
>
> Using Qt 4.3.4 , PyQt4 snapshot from 20071220 , sip 4.7.4 following
>
> example crashes python :
> >>> from PyQt4.QtCore import *
> >>> a = QByteArray()
> >>> b = QDataStream(a, QIODevice.ReadOnly)
> >>> b.readString()
>
> zsh: segmentation fault  python
>
> If you write same code using C++ you get an empty string instead which
> is more preferable over a crash.
>
> Regards,
> ismail

Fixed in tonight's snapshot - to return None rather than an empty string.

Thanks,
Phil



More information about the PyQt mailing list