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
Upgrade a development env that was working just fine in python 3.9.x to 3.10.4 then ran tests on my code base (pyramid web app that uses traversal, ZODB and some zope libs)
What I expect to happen:
Tests to pass, code to run as it ran with 3.9
What actually happened:
Whenever I have to query the catalog, an exception is raised. This is an example on a test failure:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/doctest.py", line 1346, in __run
exec(compile(example.source, filename, "single",
File "<doctest migrations.31.migrate[33]>", line 2, in <module>
File "/home/wu/REPO/models/scan.py", line 141, in search
res = self.query(
File "/home/wu/REPO/catalog.py", line 208, in query
number, results = catalog.query(query, reverse=reverse)
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/repoze/catalog/catalog.py", line 153, in query
results = queryobject._apply(self, names)
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/repoze/catalog/query.py", line 95, in _apply
return index.applyContains(self._get_value(names))
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/repoze/catalog/indexes/text.py", line 74, in applyContains
return self.apply(value)
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/zope/index/text/textindex.py", line 73, in apply
results = tree.executeQuery(self.index)
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/zope/index/text/parsetree.py", line 123, in executeQuery
return index.search_phrase(self.getValue())
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/zope/index/text/baseindex.py", line 203, in search_phrase
scores = self._search_wids(wids)
File "/home/wu/ENVS/3.10/lib/python3.10/site-packages/zope/index/text/okapiindex.py", line 347, in _c_search_wids
score(result, items, docid2len, idf, meandoclen)
TypeError: 'float' object cannot be interpreted as an integer
What version of Python and Zope/Addons I am using:
Builtin and extension functions that take integer arguments no longer accept Decimals, Fractions and other objects that can be converted to integers only with a loss (e.g. that have the int() method but do not have the index() method). (Contributed by Serhiy Storchaka in bpo-37999.)
@WuShell Hi, you are using zope.index version which does not support Python 3.10. Please update to version 5.2.0 and report back whether this fixes your problem.
BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)
What I did:
Upgrade a development env that was working just fine in python 3.9.x to 3.10.4 then ran tests on my code base (pyramid web app that uses traversal, ZODB and some zope libs)
What I expect to happen:
Tests to pass, code to run as it ran with 3.9
What actually happened:
Whenever I have to query the catalog, an exception is raised. This is an example on a test failure:
What version of Python and Zope/Addons I am using:
FreeBSD 13.1
Python 3.10.4
More info/research.
Looking a bit at the 3.10.x changelog (https://docs.python.org/3/whatsnew/3.10.html) There is this point here:
Which points to this bugfix: python/cpython#82180
Maybe that is causing this behaviour?
The text was updated successfully, but these errors were encountered: