[Bug 1530888] Re: Bytes versus text issues on Python 3
Ben Nemec
openstack at nemebean.com
Thu Aug 8 19:36:42 UTC 2019
** Changed in: python-tooz
Status: Triaged => Fix Released
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-tooz in Ubuntu.
https://bugs.launchpad.net/bugs/1530888
Title:
Bytes versus text issues on Python 3
Status in tooz:
Fix Released
Status in python-tooz package in Ubuntu:
Fix Released
Bug description:
It's unclear to me if group and member identifiers are supposed to be
bytes or text strings in tooz. Try to run unit tests with "python3
-bb" to see BytesWarning errors.
It looks like bytes is preferred, but it's cause some conversion
issues on Python 3.
Tooz errors have group_id and member_id attributes which are used to
format error messages. Example:
---
class MemberAlreadyExist(ToozError):
"""Exception raised when the caller try to join a group but a member
with the same identifier belongs to that group.
"""
def __init__(self, group_id, member_id):
self.group_id = group_id
self.member_id = member_id
super(MemberAlreadyExist, self).__init__(
"Member %s has already joined %s" %
(member_id, group_id))
---
If group_id and member_id must be bytes, we must decode them to format
the error message. "%s" % b'bytes' raises a BytesWarning when python3
is used with -bb.
To manage notifications about this bug go to:
https://bugs.launchpad.net/python-tooz/+bug/1530888/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list