You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
N_ITEMS=8000# 7761 was the smallest value that raised RuntimeErrordeftest_clone_large_btree_container():
obj=BTreeContainer()
forninrange(N_ITEMS):
obj[str(n)] =Nonezope.copy.clone(obj) # raises RuntimeError: maximum recursion depth exceeded
What I expect to happen:
Copy the container
What actually happened:
Traceback (most recent call last):
File "/home/mg/src/zope-copy-stack-overflow-error/repro.py", line 16, in <module>
test_clone_large_btree_container()
File "/home/mg/src/zope-copy-stack-overflow-error/repro.py", line 12, in test_clone_large_btree_container
zope.copy.clone(obj)
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/copy/__init__.py", line 31, in clone
pickler.dump(obj)
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/copy/__init__.py", line 85, in id
hook = interfaces.ICopyHook(obj, None)
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/component/_api.py", line 152, in adapter_hook
return sitemanager.queryAdapter(object, interface, name, default)
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/interface/registry.py", line 354, in queryAdapter
return self.adapters.queryAdapter(object, interface, name, default)
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/proxy/__init__.py", line 573, in <lambda>
return property(lambda self: func.__get__(self))
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/container/contained.py", line 932, in __get__
for iface in list(provided):
File "/home/mg/src/zope-copy-stack-overflow-error/.tox/py39/lib/python3.9/site-packages/zope/interface/interface.py", line 516, in interfaces
for base in self.__bases__:
RecursionError: maximum recursion depth exceeded
What version of Python and Zope/Addons I am using:
Python on Linux (Python 3.9 on Ubuntu 22.10, among other combinations)
zope.container 4.10, zope.copy 4.3
The text was updated successfully, but these errors were encountered:
A OOBucket holds up to 20 items by default. The buckets in an OOBTree constitue a singly-linked list, with the OOBTree itself holding additional direct references to all the buckets. Here's a tree with 100 items:
An OOBTree with 8000 items has a bit over 500 buckets, depending on the order of insertion. sys.getrecursionlimit() is 1000 by default. If pickle uses up two stack frames per object, a depth-first graph traversal starting from the first bucket will hit the limit.
What I did:
What I expect to happen:
Copy the container
What actually happened:
What version of Python and Zope/Addons I am using:
Python on Linux (Python 3.9 on Ubuntu 22.10, among other combinations)
zope.container 4.10, zope.copy 4.3
The text was updated successfully, but these errors were encountered: