[Bug 1530888] Related fix merged to tooz (master)

OpenStack Infra 1530888 at bugs.launchpad.net
Mon Oct 8 12:03:13 UTC 2018


Reviewed:  https://review.openstack.org/601632
Committed: https://git.openstack.org/cgit/openstack/tooz/commit/?id=b5ebc60660f24e462ad5ee4aeb7028276f47d449
Submitter: Zuul
Branch:    master

commit b5ebc60660f24e462ad5ee4aeb7028276f47d449
Author: James Page <james.page at ubuntu.com>
Date:   Tue Sep 11 10:14:32 2018 -0600

    Ensure consistent encoding of strings for ID
    
    Ensure that ID's are correctly binary encoded when strings are
    provided, resolving compatibility issues with Python 3.
    
    Change-Id: Ia417920a7600aacd43f17b95ecd6a34b5faa226b
    Related-Bug: 1530888

-- 
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:
  Triaged
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