[Bug 1530888] Re: Bytes versus text issues on Python 3

James Page james.page at ubuntu.com
Tue Sep 11 16:26:57 UTC 2018


** Also affects: python-tooz (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: python-tooz (Ubuntu)
       Status: New => In Progress

** Changed in: python-tooz (Ubuntu)
   Importance: Undecided => High

** Changed in: python-tooz (Ubuntu)
    Milestone: None => ubuntu-18.10

** Changed in: python-tooz (Ubuntu)
     Assignee: (unassigned) => James Page (james-page)

-- 
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:
  In Progress

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