kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r469504092
##########
File path: python/proton/_message.py
##########
@@ -90,13 +90,18 @@ def _check(self, err):
def _check_property_keys(self):
for k in self.properties.keys():
- if isinstance(k, unicode):
- # py2 unicode, py3 str (via hack definition)
+ # Check for string types. (py2: unicode, py3: str via type hack
above)
+ # or string subclasses. Exclude string subclasses symbol and char.
+ if isinstance(k, unicode) and not (type(k) is symbol or type(k) is
char):
+ # Convert string subclasses to string
+ if not type(k) is unicode:
+ self.properties[unicode(k)] = self.properties.pop(k)
Review comment:
This is to make the change only if the key is a subclass of unicode, but
not unicode itself. As we first check with isinstance(unicode), all unicode and
their subclasses are included, and continue will be called. But for sublcasses
only, a conversion is made, hence the second test using type() is unicode.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]