NOTICE: Breaking change in the Python buildpack for all Python 2.7 compiled extension modules


Stephen Levine
 

Hi All,

Please note this breaking change in upcoming releases of the Python
buildpack.

Summary:

The next release of the Python buildpack after April 1, 2017 will switch
the unicode mode of all currently included versions of Python 2.7 from
UCS-2 to UCS-4. This will break any pre-compiled extensions modules for
Python 2.7 that you may be vendoring with your app. If this affects you,
continue reading to learn about a smooth migration strategy.

In the next release of the Python buildpack (1.5.16) we will provide a
version of Python 2.7.13 called "2.7.13-ucs2" that maintains UCS-2 support.
This version will be included in the buildpack ASAP (before the other
versions of Python 2.7 are migrated to UCS-4), and it will be available
until May 1, 2017. This means that if you switch to 2.7.13-ucs2 before
April 1, you will have until May 1 to convert any compiled extension
modules you may be using to UCS-4. Your app's Python version may be
specified in the runtime.txt file at the app root.

Background:

Most Python 2.7 distributions on Linux, as well as the latest Python 2.7
versions distributed in the Heroku version of the buildpack, store unicode
data in UCS-4. Most Python distributions for macOS and Windows still store
data in UCS-2. As compiled Python modules must be compiled for Linux to
work with the Python buildpack, we've decided to migrate to UCS-4.

Unfortunately, compiled extension modules must be compiled for either UCS-2
or UCS-4, and the mode your extensions are compiled with must match the
mode that Python is compiled with.

Thanks,
Stephen Levine
Core CF Buildpacks PM