-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix build and all deprecation warnings on Python 3. #11
base: master
Are you sure you want to change the base?
Conversation
Fixes zopyx#10. This updates the package to use the new-in-Python-3 unicode APIs when available.
travis-ci.org is shutting down so there's currently no CI running on PRs here. I have tested it locally with Python 2.7, 3.5 and 3.9. |
Hi @zopyx ! I haven't been around for awhile, but this patch is becoming more important. Without it, it doesn't compile on Python 3.12 at all (though I will still need to make one adjustment for 3.12, which I can add to this PR). Any hope of getting this released anytime soon? |
Python 3.12 started complaining about getting a void* instead of an integer from the call to PyObject_HEAD_INIT in our types. The fix, which works on all versions of Python, is to use the correct PyVarObject_HEAD_INIT. PyTypeObject has always been a PyObject_VAR_HEAD type.
My latest commit adds support for the newer versions of Python, while still being compatible back to Python 2.7. There are remaining warning about the pre-ANSI C code in void
hashtable_destroy(table, del)
hashtable *table;
int del;
{
} Instead of the standard void
hashtable_destroy(hashtable* table, int del)
{
} |
Hi there, the project is unmaintained and dead since 2019: https://community.plone.org/t/textindexng3-end-of-lifetime-announcement/8111 I recommend to fork the repo. |
Thanks, I understand this is unmaintained. In our case, we need it for legacy code that we're currently modernizing, with hopes to eventually drop it. I'd be more than happy to fork the project and publish an updated version to PyPI if you'd give me the rights. I can't promise any more maintenance after that, but hopefully that's helpful. |
Fixes #10.
This updates the package to use the new-in-Python-3 unicode APIs when available. Previously there were ~50 deprecation warnings. Now there are none.
This also converts most uses of
size_t
intoPy_ssize_t
, because that's what the Python APIs use and return (e.g., for unicode length, sequence length, etc). This eliminates more warnings and casts.