deepcopy and ReferenceListProperty

92 views
Skip to first unread message

Yoel Koenka

unread,
Aug 10, 2017, 10:46:12 AM8/10/17
to kivy-...@googlegroups.com
I have a strange problem with deepcopy.
Somehow the following code breaks, but not on all machines.

from kivy.properties import NumericProperty, ReferenceListProperty
x = NumericProperty()
y = NumericProperty()
pos = ReferenceListProperty(x, y)
l = [pos]
from copy import deepcopy
deepcopy(l)


 Traceback (most recent call last):
   File "<input>", line 1, in <module>
   File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
     y = copier(x, memo)
   File "/usr/lib/python2.7/copy.py", line 230, in _deepcopy_list
     y.append(deepcopy(a, memo))
   File "/usr/lib/python2.7/copy.py", line 182, in deepcopy
     rv = reductor(2)
   File "stringsource", line 2, in kivy.properties.ReferenceListProperty.__reduce_cython__
 TypeError: no default __reduce__ due to non-trivial __cinit__

It happens only on one PC that we have (Ubuntu 16.04) but not on others with the same OS.
Any idea why this could be happening?
Thanks in advance,
Joel

extra info:
pip freeze gives the following:
alabaster==0.7.10
Babel==2.4.0
certifi==2017.4.17
chardet==3.0.4
coverage==4.4.1
cycler==0.10.0
Cython==0.26
docopt==0.6.2
docutils==0.13.1
functools32==3.2.3.post2
gitdb==0.6.4
gitdb2==2.0.2
GitPython==2.1.5
idna==2.5
imagesize==0.7.1
Jinja2==2.9.6
Kivy==1.10.0
Kivy-Garden==0.1.4
MarkupSafe==1.0
matplotlib==2.0.2
nose==1.3.7
numpy==1.13.0
opencv-python==3.2.0.8
pipreqs==0.4.9
psutil==5.2.2
Pygments==2.2.0
pyparsing==2.2.0
pypi-publisher==0.0.4
python-dateutil==2.6.0
pytz==2017.2
requests==2.18.1
Shapely==1.5.17.post1
six==1.10.0
smmap==0.9.0
smmap2==2.0.3
snowballstemmer==1.2.1
Sphinx==1.6.3
sphinx-rtd-theme==0.2.4
sphinxcontrib-websupport==1.0.1
subprocess32==3.2.7
typing==3.6.2
urllib3==1.21.1
yarg==0.1.9


Yoel Koenka

unread,
Aug 10, 2017, 11:07:19 AM8/10/17
to kivy-...@googlegroups.com
Short update:
I've created a virtualenv on my PC (which didn't show the problem) with these requirements and the problem isn't reproduced
Very strange...

Yoel Koenka

unread,
Aug 10, 2017, 11:47:53 AM8/10/17
to kivy-...@googlegroups.com
And if I repeat the same process in the "problematic" computer (new venv with the same requirements) the problem arises.

Alexander Taylor

unread,
Aug 10, 2017, 6:47:47 PM8/10/17
to Kivy users support
This problem does seem strange, I don't see any obvious reason for it.

Do you really need to deepcopy the ReferenceListProperty object itself?

Yoel Koenka

unread,
Aug 21, 2017, 9:11:55 AM8/21/17
to kivy-...@googlegroups.com
Anyone?

Bill Janssen

unread,
Aug 23, 2017, 2:30:15 PM8/23/17
to Kivy users support
The only thing which could account for this is different versions of either Python or Cython, I'd think.  So I'd check that very carefully.

Bill
Reply all
Reply to author
Forward
0 new messages