473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

IMPORTANT 2.5 API changes for C Extension Modules

If you don't write or otherwise maintain Python Extension Modules
written in C (or C++), you can stop reading.

Python 2.5 alpha 1 is in the process of being released later today.
There are important changes that are in 2.5 to support 64-bit systems.
These changes can cause Python to crash if your module is not upgraded
to support the changes. Python was changed internally to use 64-bit
values on 64-bit machines for indices. If you've got a machine with
more than 16 GB of RAM, it would be great if you can test Python with
large (> 2GB) strings and other sequences.

For more details about the Python 2.5 schedule:
http://www.python.org/dev/peps/pep-0356/
For more details about the 64-bit change:
http://www.python.org/dev/peps/pep-0353/
How to fix your module:
http://www.python.org/dev/peps/pep-0...ion-guidelines

The effbot wrote a program to check your code and find potential
problems.
http://svn.effbot.python-hosting.com.../ssizecheck.py

Please test and upgrade your extension modules!

Cheers,
n

Apr 5 '06 #1
3 990
Thank you for taking the time to pull the relevant links together and
make this post, Neal.

Apr 6 '06 #2
On 05.04.2006, at 08:44, nn******@gmail.com wrote:
Python 2.5 alpha 1 is in the process of being released later today.
There are important changes that are in 2.5 to support 64-bit systems.
These changes can cause Python to crash if your module is not upgraded
to support the changes. Python was changed internally to use 64-bit
values on 64-bit machines for indices. If you've got a machine with
more than 16 GB of RAM, it would be great if you can test Python with
large (> 2GB) strings and other sequences.

For more details about the Python 2.5 schedule:
http://www.python.org/dev/peps/pep-0356/
For more details about the 64-bit change:
http://www.python.org/dev/peps/pep-0353/
How to fix your module:
http://www.python.org/dev/peps/pep-0...ion-guidelines


Thanks for the information!

One question: Is there a safe way to keep extension modules backward-
compatible with older Python versions? I am thinking of something like

#ifndef PY_SSIZE_T_DEFINED
typedef Py_ssize_t int;
#endif

assuming that Python 2.5 defines PY_SSIZE_T_DEFINED.

Konrad.
--
------------------------------------------------------------------------
-------
Konrad Hinsen
Laboratoire Leon Brillouin (CEA-CNRS), CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: ko***********@cea.fr
------------------------------------------------------------------------
-------
Apr 6 '06 #3
ko***********@laposte.net wrote:
One question: Is there a safe way to keep extension modules backward-
compatible with older Python versions?
absolutely.
I am thinking of something like

#ifndef PY_SSIZE_T_DEFINED
typedef Py_ssize_t int;
#endif

assuming that Python 2.5 defines PY_SSIZE_T_DEFINED.


the "official" way to do this is described in the conversion guidelines:

http://www.python.org/dev/peps/pep-0...ion-guidelines

</F>

Apr 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: ronwer | last post by:
Hello, The title doesn't completely cover the question I have, but it's a bit more complicated problem we have. We are using a database, based on Acces, but developed by a third party...
3
by: Simon Burton | last post by:
Hi, I'm having some trouble linking one extension module to another because the linker expects a "lib" prefix and my python modules cannot have this prefix. I found two ways of doing it on a...
0
by: Neal Norwitz | last post by:
If you don't write or otherwise maintain Python Extension Modules written in C (or C++) or embed Python in your application, you can stop reading. Python 2.5 alpha 1 was released April 5, 2006. ...
1
by: zpinhead | last post by:
I am unable to get my downloaded extension from pecl to link up with php properly. seems like the php.so I could not use pear install http. pear claimed the extension was already installed....
1
by: Mark Asbach | last post by:
Hi pythonians, I'm one of the maintainers of an open source image processing toolkit (OpenCV) and responsible for parts of the autotools setup. The package mainly consists of four shared...
1
by: Petr Prikryl | last post by:
Do you think that the following could became PEP (pre PEP). Please, read it, comment it, reformulate it,... Abstract Introduction of the mechanism for language extensions via modules...
0
by: shamirza | last post by:
· What is view state and use of it? The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested...
1
by: Stefan Braumeister | last post by:
Hi NG, I got some difficult problem that drives me nuts. I wrote a relatively simple extension that reads binary files and extracts some data. If I call the script, that uses my extension via...
15
by: kyosohma | last post by:
Hi, I am trying to get a small group of volunteers together to create Windows binaries for any Python extension developer that needs them, much like the package/extension builders who volunteer...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.