[PyQt] How to read/write in QSharedMemory

Phil Thompson phil at riverbankcomputing.com
Wed Jul 29 20:42:26 BST 2009


On Wed, 29 Jul 2009 14:01:38 +0200, TGS France Alexandre
<alexandre.raczynski at technogerma.fr> wrote:
> Thanks for the quick answer. I am using Python 3.0.1 and buffer has been 
> replaced by memoryview.
> Anyway it works fine to access QBuffer internal data but it crashes when 
> attempting to access QSharedMemory data.
> 
> Here is the piece of code that crash:
> 
> 
> from PyQt4 import QtCore
> sharedMemory = QtCore.QSharedMemory('key')
> sharedMemory.create(256)
> sharedMemory.lock()
> view = memoryview(sharedMemory.data()) # CRASH!

Should be fixed in tonight's SIP snapshot.

Thanks,
Phil


More information about the PyQt mailing list