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

[python] Non-string message property keys not handled correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • python-binding
    • None

    Description

      The AMQP 1.0 spec allows only string keys for message properties.

      Proton's Python binding has a method (_message.py:91 _check_property_keys()) for checking message property keys, but it does not handle all cases correctly:

      1. Proton types Symbol and Char are derived from string, and are allowed in the test. This results in an illegal encoding.
      2. Because in Python 2, many coders carelessly use string literals without the required u'' prefix (and thus results in a bytes type), bytes types are converted to unicode string types. However, the encode() function is being used, which simply returns a binary type in Python 2 and raises an error in Python 3. This should probably be the decode() method, which returns a string and works for both Python 2 and 3.

      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: