| 1 |
:orphan: |
| 2 |
|
| 3 |
.. _pyporting-howto: |
| 4 |
|
| 5 |
************************************* |
| 6 |
How to port Python 2 Code to Python 3 |
| 7 |
************************************* |
| 8 |
|
| 9 |
:author: Brett Cannon |
| 10 |
|
| 11 |
Python 2 reached its official end-of-life at the start of 2020. This means |
| 12 |
that no new bug reports, fixes, or changes will be made to Python 2 - it's |
| 13 |
no longer supported: see :pep:`373` and |
| 14 |
`status of Python versions <https://devguide.python.org/versions>`_. |
| 15 |
|
| 16 |
If you are looking to port an extension module instead of pure Python code, |
| 17 |
please see :ref:`cporting-howto`. |
| 18 |
|
| 19 |
The archived python-porting_ mailing list may contain some useful guidance. |
| 20 |
|
| 21 |
Since Python 3.11 the original porting guide was discontinued. |
| 22 |
You can find the old guide in the |
| 23 |
`archive <https://docs.python.org/3.10/howto/pyporting.html>`_. |
| 24 |
|
| 25 |
|
| 26 |
Third-party guides |
| 27 |
================== |
| 28 |
|
| 29 |
There are also multiple third-party guides that might be useful: |
| 30 |
|
| 31 |
- `Guide by Fedora <https://portingguide.readthedocs.io>`_ |
| 32 |
- `PyCon 2020 tutorial <https://www.youtube.com/watch?v=JgIgEjASOlk>`_ |
| 33 |
- `Guide by DigitalOcean <https://www.digitalocean.com/community/tutorials/how-to-port-python-2-code-to-python-3>`_ |
| 34 |
- `Guide by ActiveState <https://www.activestate.com/blog/how-to-migrate-python-2-applications-to-python-3>`_ |
| 35 |
|
| 36 |
|
| 37 |
.. _python-porting: https://mail.python.org/pipermail/python-porting/ |