python2 will not be supported in the visible future. However,existing script, projects need migrate to python3 while keeping compatibility with 2. This is quite challenging work since almost all Python 2 programs require some modifications to run properly under 3. We are working on avocado-vt and tp-libvirt projects migrating,and nearly 650 files were changed without interrupting production. This talk will share our best practice experience and the pain points encountered: 1)Define migration strategies 2)Best Practices in idioms,including exceptions,importing,standard library numbers,dictionaries,Built-in Function change,etc... 3)Some automatic tools to help migration:sixer,2to3 4)Use virtualenv to set up validating environments 5)Special case handling: deprecated module removal
I am an open source contributor and promoter.I work at Red Hat, and have 17+ years working experiences in various companies such as:Oracle, Motorola, Siemens.