CroissanceCommune / autonomie

Autonomie est un progiciel de gestion à l'usage des CAE
GNU General Public License v3.0
20 stars 12 forks source link

Migrate Autonomie to python 3 #479

Open tonthon opened 6 years ago

tonthon commented 6 years ago

Python 2.7 is only supported up to 2020

JocelynDelalande commented 6 years ago

Est-ce qu'on pourrait démarrer ça doucement en commençant par utiliser from __future__ import unicode_literals dans tous les nouveaux fichiers que l'on ajoute ?

paul-kilya commented 6 years ago

Extrait de la documentation python-future :

In general, it is more compelling to use unicode_literals when back-porting new or existing Python 3 code to Python 2/3 than when porting existing Python 2 code to 2/3. In the latter case, explicitly marking up all unicode string literals with u'' prefixes would help to avoid unintentionally changing the existing Python 2 API. However, if changing the existing Python 2 API is not a concern, using unicode_literals may speed up the porting process.

This section summarizes the benefits and drawbacks of using unicode_literals. To avoid confusion, we recommend using unicode_literals everywhere across a code-base or not at all, instead of turning on for only some modules.

http://python-future.org/imports.html#should-i-import-unicode-literals

Je ne suis pas spécialiste Python peut être que la proposition de Jocelyn est quand même pertinente, mais puisque je suis tombé là dessus en cherchant à quoi ça correspondait je vous le met ici.