Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
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:
- if binary, convert to unicode string;
- if any other type, raise an exception
before sending a message.