zopefoundation / BTrees

Other
80 stars 28 forks source link

'IFBucket' object has no attribute 'byValue' when running with PURE_PYTHON #187

Open justincinmd opened 1 year ago

justincinmd commented 1 year ago

The dedupe package uses BTree, and raises the following exception when running under pypy 3.8 or python 3.10 with the PURE_PYTHON environment variable set to 1.

  File "/etc/build/venvs/default/lib/python3.10/site-packages/dedupe/tfidf.py", line 39, in search
    center for score, center in self._index.apply(query_list, threshold)
  File "/etc/build/venvs/default/lib/python3.10/site-packages/dedupe/canopy_index.py", line 76, in apply
    filtered_results: list[tuple[float, int]] = results.byValue(qw * threshold)
  File "/etc/build/venvs/default/lib/python3.10/site-packages/persistent/persistence.py", line 292, in __getattribute__
    return oga(self, name)
AttributeError: 'IFBucket' object has no attribute 'byValue'

The byValue method is missing when the results object is inspected in a debugger. In python 3.10 with the C extensions, byValue works correctly.

icemac commented 1 year ago

@jamadden @d-maurer Do you have an idea on this issue?