Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jamadden
Copy link
Contributor

@jamadden jamadden commented May 20, 2021

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 into Py_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.

Fixes zopyx#10.

This updates the package to use the new-in-Python-3 unicode APIs when available.
@jamadden
Copy link
Contributor Author

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.

@jamadden
Copy link
Contributor Author

jamadden commented Sep 3, 2024

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.
@jamadden
Copy link
Contributor Author

jamadden commented Sep 3, 2024

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 hashtable.c. It is still using the no-definition function definitions. This is likely to eventually be unsupported by any compilers.

void
hashtable_destroy(table, del)
	hashtable	*table;
	int			 del;
{
}

Instead of the standard

void
hashtable_destroy(hashtable* table, int del)
{
}

@zopyx
Copy link
Owner

zopyx commented Sep 3, 2024

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.
If you want to create a new release on PyPI, I can grant you the related access rights.

@jamadden
Copy link
Contributor Author

jamadden commented Sep 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to build on Python 3 with errors about PyInt_AS_LONG (with certain compiler options)
2 participants