I just wanted to drop a little post into the universe that support for Python 2.x has officially stopped, and is at End of Life (EOL). What’s this about updates into April 2020? What does this mean for hosted/serverless solutions, like AWS Lambda or Heroku?

This post should help.

Python 2.x EOL Information

General Information About Python 2.7 EOL

From the Official Python release schedule page for 2.7:

Being the last of the 2.x series, 2.7 will receive bugfix support until 2020. Support officially stops January 1 2020, but the final release will occur after that date. Planned future release dates: 2.7.18 code freeze January, 2020

2.7.18 release candidate early April, 2020

2.7.18 mid-April, 2020

The last update, releasing in April, is now in code freeze. You can see the discussion around this here: The CPython Developer’s Guide - Update Python 2.7 EOL date

”…the following projects have pledged to drop support for Python 2.7 no later than 2020, coinciding with the Python development team’s timeline for dropping support for Python 2.7.”

AWS Lambda Python 2.7 Runtime

AWS Lambda will actually continue to apply critical security patches until at least the end of 2020:

To allow you additional time to prepare, AWS Lambda will continue to provide critical security patches for the Python 2.7 runtime until at least December 31, 2020. Lambda’s scope of support includes the Python interpreter and standard library, but does not extend to third-party packages.

Simple Auditing of AWS Lambda Runtimes

For a simple place to start, when it comes to auditing what AWS Lambdas are using the python2.7 runtime, we can run the following awscli command (using default --region , --profile , and --output config values):

# Add --region, --profile, and --output args if needed aws lambda list-functions --query 'Functions[?Runtime==`python2.7`]' # -OR- # If wanting only the names of the functions # Add --region, --profile, and --output args if needed aws lambda list-functions --query 'Functions[?Runtime==`python2.7`].FunctionName'

Want an alternate take using PowerShell instead? Using the AWSPowerShell for Windows or AWSPowerShell.NetCore for Linux or Mac OS module:

# Install-Module AWSPowerShell # -OR- # Install-Module AWSPowerShell.NetCore # Add -Region and -ProfileName parameters if needed (Get-LMFunctionList).where({$_.Runtime -eq 'python2.7'})

Ontop of this, AWS will make sure to notify customers as support gets closer to deprecation:

In most cases, the end-of-life date of a language version or operating system is known well in advance. If you have functions running on a runtime that will be deprecated in the next 60 days, Lambda notifies you by email that you should prepare by migrating your function to a supported runtime. In some cases, such as security issues that require a backwards-incompatible update, or software that doesn’t support a long-term support (LTS) schedule, advance notice might not be possible.

Heroku Python 2.7 Apps

Heroku gives the rundown in their Python 2.7 FAQ, providing information about how Python 2.7.17 apps will still run until April 2023 but will no longer fall under their support policy after February 1st, 2021:

You do not need to do anything to keep using Python 2. Python 2.7.17 applications will continue to build and run on Heroku 18 for the lifetime of the stack, until April 2023. However, Python 2.7 on Heroku will no longer receive security updates after January 1, 2020, as it has reached it’s community specified end of life date. Because of this, Heroku platform support for these applications will end as soon as February 1st, 2021. On that sunset date, these applications will continue to build and run, but they will no longer fall under our Support Policy.

Discussion

Have any thoughts to add, or information to share? Jump into the conversation below! I’ll try to keep this article updated with any new information that seems like it should be in here.

This article can also be viewed on dev.to