The End of Python 2
Challenge for the development in Odoo
24 October, 2019 by
The End of Python 2
manaTec GmbH, Tobias Reinwarth
 

It has been clear for some time, as of January 1, 2020, support for Python 2 will be discontinued. So there will be no more support, no more improvements and no more security updates. The reason for this is simple: for many years, Python versions 2 and 3 have existed in parallel. The effort to support both versions has simply become too high. With the end of support for Python 2, the Python community will put all resources into the further development of Python 3. What does this mean in general and what are the implications for development in Odoo? That's what we're looking at in today's blog post.

The programming language Python was developed in the early 1990s, with the first full version released in January 1994. Later, Python 2 was released in October 2000 and Python 3 in December 2008. Python 3 contains significant changes to the programming language. As a result, Python 3 became partially incompatible with the previous versions. So the developers decided to maintain parallel support until the end of 2019.

Python

Python

Python is a platform-independent programming language based on open source, which is particularly convincing due to its high range of functions, a narrow syntax and the associated clarity.

To the website

With Python, a programming language was developed that is above all simple and clear. This was achieved specifically by defining a standard library, which is reduced to the essentials and can be easily extended. Programming with Python offers extensive functionalities and is thus universally applicable. The use of Python is particularly popular in the areas of  Data Science and Machine Learning. In addition, the programming language is very easy to learn due to its simple syntax. The support of various libraries means that less code has to be written and maintained overall, thus enabling a significant increase in productivity in development projects.

One difference in the code between Python 2 and Python 3 is that the print statement has been replaced by a print function. The value to be output must now be placed as a parameter between the brackets of the function call.
One difference in the code between Python 2 and Python 3 is that the print statement has been replaced by a print function. The value to be output must now be placed as a parameter between the brackets of the function call.

After the end of support for Python 2 was announced, the Python community has over time provided extensive documentation and helpful tools to assist the transition to Python 3. So what does this mean for development in Odoo? Up to Odoo 10, no development using Python 3 is supported, only Python 2. Odoo 11 is compatible with both, Python 2 and 3, and from Odoo 12 onwards, developments are only possible with Python 3.

Compatability of Oddo 11 with Python 2 and Python 3

See here how Odoo makes its version 11 compatible with Python 2 and Python 3.

To the video

 
 

Of course, this does not mean that older Odoo versions can no longer be used or are no longer functional. However, there is a risk that Odoo modules are no longer executable by Odoos own internal or external developments, because different commands and syntax are used. Furthermore, it is possible that security vulnerabilities arise due to the lack of further development and support for Python 2. Thus, a migration to Odoo version 12 or higher is not mandatory, but highly recommended in the long run.

In summary, it can be said that it is primarily those companies that are planning the introduction and further development of Odoo version 12 or higher and those that are working in older Odoo versions and have security concerns that need to concern themselves with Python 3.

You plan the introduction of Odoo or need Support with the migration of your own Odoo instance? In numerous implementation and migration projects, we could convince our customers from our expertise, such as the ARTS Holding SE, W4 Marketing AG or Kollektiv Lumen. Therefore, we also offer you our extensive expertise. Please feel free to contact us and experience the advantages of the newest Odoo version.


Sources: www.python.org, www.odoo.com, www.wikipedia.de

 
VoIP Telephone Service using Pascom
Efficient communication via integration into Odoo