kpvdr commented on a change in pull request #256:
URL: https://github.com/apache/qpid-proton/pull/256#discussion_r469561876
##########
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:
No, encode won't work directly on subclasses of unicode.
Data.put_mappings throws a KeyError, as the subclass name is not known.
----------------------------------------------------------------
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]