On 08/05/13 22:17 +0300, Kalle Olavi Niemitalo said ... > Y Giridhar Appaji Nag <[EMAIL PROTECTED]> writes: > > > In Python 2.5, PyString_AsStringAndSize takes Py_ssize_t* instead of int* as > > its last argument. This causes ELinks 0.12 build failures on 64bit archs if > > Python 2.5 is used for building the Python hooks. > > Does ELinks 0.11 also fail to build? Does it work correctly?
I did not try this but I am certain it would failt to build. > The Python scripting module is marked as experimental, so build > failures caused by it might not have to be fixed in the stable > elinks-0.11 branch. OTOH, if it builds but corrupts memory at > runtime, that's more serious. Indeed, I uploaded a snapshot of elinks 0.12 to Debian experimental with experimental features and --debug enabled. This is a Debian "experimental" only bug. > I think we should copy this code snippet from the public-domain > PEP 353 <http://www.python.org/dev/peps/pep-0353/>: > > #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) > typedef int Py_ssize_t; > #define PY_SSIZE_T_MAX INT_MAX > #define PY_SSIZE_T_MIN INT_MIN > #endif > > into src/scripting/python/core.h, with a comment saying where it > came from. Then also change python_menu() to use Py_ssize_t for > the result of PySequence_Length(items) and return NULL if length > exceeds INT_MAX. That and script_hook_pre_format_html() are the > only relevant uses of int in /src/scripting/python/, I think. OK. I will try and submit a patch, however, I don't have a 64bit machine to compile and test so it might take some time because I don't want to submit an untested patch. Giridhar -- Y Giridhar Appaji Nag | http://appaji.net/
signature.asc
Description: Digital signature
_______________________________________________ elinks-dev mailing list [email protected] http://linuxfromscratch.org/mailman/listinfo/elinks-dev
