This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients cgohlke, python-dev, serhiy.storchaka, vstinner
Date 2013-09-05.07:12:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
2013/9/5 Christoph Gohlke <>:
> I am aware of two 3rd party C extensions that use the value of interpaddr():
> Both parse the PyObject returned by interpaddr() into a Py_ssize_t variable using `PyArg_ParseTuple(PyObject*, "n", &Py_ssize_t)` and then cast the Py_ssize_t variable to a (TkappObject*).

Ok, the code looks correct. Py_ssize_t is supposed to have the same
size than a void*.

> Can a PyLong with a value > 3**31 be parsed into a Py_ssize_t on 32 bit platforms? Could this become a problem on systems where 32 bit processes can address more than 2 GB?

No, values >= 2^31 will raise an error.

On Linux, addresses with the 32th bit set (range
0x80000000-0xffffffff) are reserved for the Linux kernel. So
interpaddr() should be in the range 0x00000000-0x7fffffff.

If the code worked before my patch, there is not reason for not
working with the patch. My patch only has an impact on one specific
platform: Windows 64 bit, the only platform where sizeof(long) <
sizeof(void*) (on all other platforms supported by Python,
sizeof(void*) == sizeof(long)).
Date User Action Args
2013-09-05 07:12:35vstinnersetrecipients: + vstinner, cgohlke, python-dev, serhiy.storchaka
2013-09-05 07:12:35vstinnerlinkissue18909 messages
2013-09-05 07:12:35vstinnercreate