Proposal to remove Python 2 support

Paul Koning
Wed Sep 16 15:03:15 GMT 2020

> On Sep 16, 2020, at 9:53 AM, Andrew Burgess <> wrote:
> * Joel Brobecker <> [2020-09-16 06:00:13 -0700]:
>>> That has no sense for me because Python 2 doesn't disappear from distros.
>> I don't know how long this is going to be True, but "distros" have
>> been shipping Python 3.x for quite a while now, so lack of Python 2
>> support wouldn't prevent you from building GDB with Python support
>> enabled.
> But a user might potentially have a significant body of Python 2 code
> that they run through GDB, so it's not as simple as "just" building
> with Python 3 and off they go.

An interesting experiment would be to take some significant Python 2 based GDB scripts and see (a) if they run unchanged with Python 3, (b) if they run correctly if processed through the 2to3 tool.

For many situations it's easy to write a bilingual Python script, and in scripts that don't use "print" statements the differences are often tiny or non-existent.


More information about the Gdb mailing list