PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 983 - copy.deepcopy raises SystemError with QColor
: copy.deepcopy raises SystemError with QColor
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtGui
: 1.0.5
: PC Linux
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2011-08-22 06:37 EEST by bbreslauer
Modified: 2011-08-23 00:35 EEST (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bbreslauer 2011-08-22 06:37:18 EEST
I have an occasional problem creating deepcopy's of some QColor objects. If I
create a blank (invalid) QColor() and then try to deepcopy it, I get a
"SystemError: NULL result without error in PyObject_Call". If the QColor has a
valid RGB value, though, it copies just fine. deepcopy'ing blank QColor objects
works fine with PyQT4 (which I am porting an application from). Commands to
reproduce this are:

>>> from PySide.QtGui import QColor
>>> import copy
>>> copy.deepcopy(QColor())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/copy.py", line 182, in deepcopy
    rv = reductor(2)
SystemError: NULL result without error in PyObject_Call
>>> copy.deepcopy(QColor(1,2,3))
<PySide.QtGui.QColor(ARGB 1, 0.00392157, 0.00784314, 0.0117647)  at 0x2591b90>

I would expect copy.deepcopy(QColor()) to return another invalid QColor(). I
think SystemError this has to do with __reduce__ not working with an invalid
QColor. i.e.

>>> QColor().__reduce__()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: error return without exception set
>>> QColor(1,2,3).__reduce__()
(<built-in function fromRgbF>, (0.00392156862745098, 0.00784313725490196,
0.011764705882352941, 1.0))

I'm running Arch Linux, kernel 3.0.3 with PySide 1.0.5. Is this considered a
bug, or is this not supposed to be supported?
Comment 1 renato filho 2011-08-22 23:30:18 EEST
fixed on pyside commit:

commit 6311d46d0dbbeea195de8400298314b4b3188a8d
Author: Renato Filho <renato.filho@openbossa.org>
Date:   Mon Aug 22 14:32:27 2011 -0300
Comment 2 renato filho 2011-08-23 00:35:41 EEST
Released on PySide 1.0.6