← Back to team overview

openerp-community team mailing list archive

Re: OCA guidelines for code compatibility with Python 2.6

 

On the community side, we could encourage the following:
* importing from __future__
* handling exceptions in a forward compatible way
* not using longs
* handling string, bytes and unicode in a forward compatible way
* using proper shebangs in scripts which are only python2 compatible (#!/usr/bin/env python2)

Le 2014-02-24 13:43, Pedro Manuel Baeza Romero a écrit :
You are right, Raphael, but first effort must come from OpenERP itself,
because I think up to now, OpenERP base doesn't work with Python 3,
doesn't it? Next LTS release of Ubuntu may include by default only
Python 3 [1], so maybe it could be a push forward to improve this
compatibility.

Regards.

[1] https://wiki.ubuntu.com/Python/3


2014-02-24 19:36 GMT+01:00 Raphael Valyi <rvalyi@xxxxxxxxx
<mailto:rvalyi@xxxxxxxxx>>:

    Hello,

    I have no strong opinion on that this, but still I share mine: I
    would say once we are able to ensure we can follow current Python
    releases (3.x), then we can afford the luxury to look backward to
    try no breaking older Python versions.
    As we are unable to catch up with the Python 3.x line, which isn't
    exactly the bleeding edge either as it's 5 years old already, I
    would say we should focus our efforts to be able to make that move
    before spending effort on compatibility with older versions.
    Dropping Python 2.6 support and ensuring compat with latest 2.7 is
    actually making efforts to support 3.x if you understand properly
    latest 2.7 releases policies.

    My 0.02 R$


    --
    Raphaël Valyi
    Founder and consultant
    http://twitter.com/rvalyi <http://twitter.com/#!/rvalyi>
    +55 21 2516 2954 <tel:%2B55%2021%202516%202954>
    www.akretion.com <http://www.akretion.com/>




    On Mon, Feb 24, 2014 at 1:27 PM, Ferdinand Gassauer
    <office@xxxxxxxxxx <mailto:office@xxxxxxxxxx>> wrote:

        On 2014-02-24 20:00, Daniel Reis wrote:

        I think in general the code should be 2.6 compatible for.
        For example: in September 2013 the available virtual debian
        image came with python 2.6

        camptocamp for example uses a specially compiled python version
        for the OpenERP server to avoid python conflicts with the
        distributed python version.
        with this setup strategy one is on the save side.

        just my 2¢

        Hi all,

        In a merge proposal for 7.0. came up the question of what
        Python versions should the code be compatible with.

        In particular, a dictionay comprehension is used the,
        available in Python 2.7 but not compatible with Python 2.6.
        For reference, the MP is:
        https://code.launchpad.net/~dreis-pt/project-service/7.0-issue_task-dr/+merge/195985

        So, the question here is:
        Regarding OCA reviewed modules, should the code targeting
        OpenERP >= 7.0 be made to keep Python 2.6 compatibility?

        Regards

        Daniel Reis


        _______________________________________________
        Mailing list:https://launchpad.net/~openerp-community
        Post to     :openerp-community@xxxxxxxxxxxxxxxxxxx  <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
        Unsubscribe :https://launchpad.net/~openerp-community
        More help   :https://help.launchpad.net/ListHelp


        --
        Ferdinand


        _______________________________________________
        Mailing list: https://launchpad.net/~openerp-community
        Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
        <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
        Unsubscribe : https://launchpad.net/~openerp-community
        More help   : https://help.launchpad.net/ListHelp



    _______________________________________________
    Mailing list: https://launchpad.net/~openerp-community
    Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
    <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~openerp-community
    More help   : https://help.launchpad.net/ListHelp




_______________________________________________
Mailing list: https://launchpad.net/~openerp-community
Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~openerp-community
More help   : https://help.launchpad.net/ListHelp



References