Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-1758

[Python binding] Check message application property keys, convert binary to string

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • proton-c-0.21.0
    • python-binding
    • None

    Description

      The AMQP 1.0 specification requires message application property keys to be strings. Currently the Python binding makes no type check on message application property key types. Under Python 2, using the pattern

      props['key'] = 'value'

      results in the key being encoded as binary, whereas in Python 3, it is a unicode string. While changing the pattern to

      props[u'key'] = u'value'

      is trivially easy and would work for both versions of Python, it would help usability and AMQP wire correctness if the binding would check the key type and:

      1. if binary, convert to unicode string;
      2. if any other type, raise an exception

      before sending a message.

      Attachments

        Activity

          People

            kpvdr Kim van der Riet
            kpvdr Kim van der Riet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: