Qpid Proton
  1. Qpid Proton
  2. PROTON-199

[Proton-c] Python binding requires python 2.6+

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.3
    • Fix Version/s: 0.4
    • Component/s: proton-c
    • Labels:
      None
    • Environment:
      python versions < 2.5

      Description

      Python bindings make use of (at least two) python language features that require python versions newer than 2.5:

      • uuid
      • bytes

      In order to support older versions of the python language, these features would have to be removed, or a compatibility layer would need to be provided.

        Activity

        Hide
        Philip Harvey added a comment -

        I'm glad you raised this Jira, I've been meaning to report this for a while. I suppose the big question is what version of Python we want to support.

        I'm no expert but for purely selfish reasons I'd vote for 2.4. This is the version on the default build of the machines I have access to.

        Show
        Philip Harvey added a comment - I'm glad you raised this Jira, I've been meaning to report this for a while. I suppose the big question is what version of Python we want to support. I'm no expert but for purely selfish reasons I'd vote for 2.4. This is the version on the default build of the machines I have access to.
        Hide
        Ken Giusti added a comment -

        +1 for 2.4 - that's the oldest version of python that is supported by an "active" linux distro (Centos-5) that I'm aware of.

        Show
        Ken Giusti added a comment - +1 for 2.4 - that's the oldest version of python that is supported by an "active" linux distro (Centos-5) that I'm aware of.
        Hide
        Ken Giusti added a comment -

        I'm able to run the proton unit tests on Centos 5.9 (python 2.4.3) with the following patch:

        https://reviews.apache.org/r/9123/

        which addresses some syntax changes and the alias of the 'bytes' type.

        Centos 5.9 provides the necessary python UUID stuff via the python-uuid package (I've got python-uuid-1.30-3.el5 installed).

        Show
        Ken Giusti added a comment - I'm able to run the proton unit tests on Centos 5.9 (python 2.4.3) with the following patch: https://reviews.apache.org/r/9123/ which addresses some syntax changes and the alias of the 'bytes' type. Centos 5.9 provides the necessary python UUID stuff via the python-uuid package (I've got python-uuid-1.30-3.el5 installed).
        Hide
        Ken Giusti added a comment -

        To clarify the previous comment: I was able to install the necessary UUID libraries on my Centos 5.9 system by enabling the EPEL repo and installing the python-uuid package from that repo.

        The previous patch only addresses the use of the new "bytes" type (an alias for 'str') - the UUID issue is left unresolved (and thus not closing this bug).

        To fix the UUID compatibility issue, I was planning on copying the method used in the QPID python sources - see qpid/python/qpid/datatypes.py

        Show
        Ken Giusti added a comment - To clarify the previous comment: I was able to install the necessary UUID libraries on my Centos 5.9 system by enabling the EPEL repo and installing the python-uuid package from that repo. The previous patch only addresses the use of the new "bytes" type (an alias for 'str') - the UUID issue is left unresolved (and thus not closing this bug). To fix the UUID compatibility issue, I was planning on copying the method used in the QPID python sources - see qpid/python/qpid/datatypes.py
        Hide
        Ken Giusti added a comment -

        Here's a patch that provides just enough "uuid" support to pass the tests.

        I'm not convinced we should apply it. I'm not sure proton should get into the business of providing an alternative python uuid implementation.

        Rather, I think we should either limit our support to python 2.5, or otherwise simply avoid exporting UUID-related proton interfaces when native uuid support is not present.

        Opinions?

        Show
        Ken Giusti added a comment - Here's a patch that provides just enough "uuid" support to pass the tests. I'm not convinced we should apply it. I'm not sure proton should get into the business of providing an alternative python uuid implementation. Rather, I think we should either limit our support to python 2.5, or otherwise simply avoid exporting UUID-related proton interfaces when native uuid support is not present. Opinions?
        Hide
        Philip Harvey added a comment -

        I notice that v2.4 was released in 2004 whereas v2.5 was released in 2006 (http://en.wikipedia.org/wiki/History_of_Python#Version_release_dates). Most production systems I've seen are running on 2.6 or 2.7.

        All of this makes me think that v2.5 would be a reasonable minimum version.

        However, I'm not a serious Python developer so you should take me views on this with a pinch of salt.

        Show
        Philip Harvey added a comment - I notice that v2.4 was released in 2004 whereas v2.5 was released in 2006 ( http://en.wikipedia.org/wiki/History_of_Python#Version_release_dates ). Most production systems I've seen are running on 2.6 or 2.7. All of this makes me think that v2.5 would be a reasonable minimum version. However, I'm not a serious Python developer so you should take me views on this with a pinch of salt.
        Hide
        Rafael H. Schloming added a comment -

        Regarding the uuid patch, I think we should apply it modulo the sketchy implementation of namespace uuids. We've had this code in the qpid python client for ages and it hasn't been a maintenance issue there, and it is a pretty common thing to want to use uuids along with messaging. I think it's actually going to be the norm that a given language we're binding to won't have native support for all AMQP datatypes, and so we will be obliged to fill in the blanks at least enough so that we won't barf on messages that use the full range of types. In the case of python 2.4 we just happen to be filling in the blank with something that is compatible with what will come along later, so I don't see the harm.

        Show
        Rafael H. Schloming added a comment - Regarding the uuid patch, I think we should apply it modulo the sketchy implementation of namespace uuids. We've had this code in the qpid python client for ages and it hasn't been a maintenance issue there, and it is a pretty common thing to want to use uuids along with messaging. I think it's actually going to be the norm that a given language we're binding to won't have native support for all AMQP datatypes, and so we will be obliged to fill in the blanks at least enough so that we won't barf on messages that use the full range of types. In the case of python 2.4 we just happen to be filling in the blank with something that is compatible with what will come along later, so I don't see the harm.
        Show
        Ken Giusti added a comment - http://svn.apache.org/viewvc?view=revision&revision=1448323

          People

          • Assignee:
            Ken Giusti
            Reporter:
            Ken Giusti
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development