[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Not getting it re sip.voidptr
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2012-11-11 11:57:28
Message-ID: c567e3a492cc36d6f1898fa4efc6c3d4 () localhost
[Download RAW message or body]

On Sun, 04 Nov 2012 18:53:18 +0000, Phil Thompson
<phil@riverbankcomputing.com> wrote:
> On Sun, 4 Nov 2012 09:34:32 -0800, David Cortesi <davecortesi@gmail.com>
> wrote:
>>>> When I try assignment,
>>>>     vptr[1] = 0x00
>>>> I get the message,
>>>>     TypeError: 'int' does not have the buffer interface
>> 
>>> I can't reproduce this - can you send a short, complete test that
>>> demonstrates the problem.
>> 
>> Here you go: Ubuntu 12.10, PyQt4 4.9.3-4
>> 
>> $ python
>> Python 2.7.3 (default, Sep 26 2012, 21:53:58)
>> [GCC 4.7.2] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> from PyQt4 import QtCore, QtGui
>>>>> img = QtGui.QImage(100,100,QtGui.QImage.Format_ARGB32)
>>>>> img.fill(0xdeadbeef)
>>>>> vptr = img.bits()
>>>>> vptr.setsize(img.byteCount())
>>>>> vptr[0] = 0
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>> TypeError: 'int' does not have the buffer interface
>>>>>
> 
> Fixed in tonight's SIP snapshot - thanks.

I have backed out this fix as it make the behaviour different to
memoryview.

The correct fix is to do this...

    vptr[1] = '\x00'

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic