test_quota unit tests failing with UnicodeError from oslo gettextutils

Bug #1334774 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Matt Riedemann
Icehouse
Fix Released
Undecided
Unassigned

Bug Description

I'm seeing something like this in many unrelated changes:

2014-06-26 15:55:57.452 | FAIL: glance.tests.unit.test_quota.TestImageLocationQuotas.test_add_too_many_image_locations
2014-06-26 15:55:57.452 | tags: worker-0
2014-06-26 15:55:57.452 | ----------------------------------------------------------------------
2014-06-26 15:55:57.452 | Traceback (most recent call last):
2014-06-26 15:55:57.452 | File "glance/tests/unit/test_quota.py", line 568, in test_add_too_many_image_locations
2014-06-26 15:55:57.452 | self.assertIn('Attempted: 2, Maximum: 1', str(exc))
2014-06-26 15:55:57.452 | File "glance/openstack/common/gettextutils.py", line 333, in __str__
2014-06-26 15:55:57.452 | raise UnicodeError(msg)
2014-06-26 15:55:57.452 | UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.

http://logs.openstack.org/63/102863/1/check/gate-glance-python27/6ad16a3/console.html

http://logstash.openstack.org/#eyJzZWFyY2giOiJtZXNzYWdlOlwiVW5pY29kZUVycm9yOiBNZXNzYWdlIG9iamVjdHMgZG8gbm90IHN1cHBvcnQgc3RyKCkgYmVjYXVzZSB0aGV5IG1heSBjb250YWluIG5vbi1hc2NpaSBjaGFyYWN0ZXJzLiBQbGVhc2UgdXNlIHVuaWNvZGUoKSBvciB0cmFuc2xhdGUoKSBpbnN0ZWFkLlwiIEFORCB0YWdzOmNvbnNvbGUgQU5EIHByb2plY3Q6XCJvcGVuc3RhY2svZ2xhbmNlXCIiLCJmaWVsZHMiOltdLCJvZmZzZXQiOjAsInRpbWVmcmFtZSI6IjYwNDgwMCIsImdyYXBobW9kZSI6ImNvdW50IiwidGltZSI6eyJ1c2VyX2ludGVydmFsIjowfSwic3RhbXAiOjE0MDM4MDQ5ODkwMDZ9

There is a gettextutils sync here: https://review.openstack.org/#/c/91047/

But that didn't hit this in the check queue, but hit it after being approved.

Revision history for this message
Matt Riedemann (mriedem) wrote :
tags: added: i18n
Changed in glance:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/102915

Changed in glance:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/102915
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=834e1f2150c6f2afd92036e6b7f53afee4006682
Submitter: Jenkins
Branch: master

commit 834e1f2150c6f2afd92036e6b7f53afee4006682
Author: Matt Riedemann <email address hidden>
Date: Thu Jun 26 11:59:08 2014 -0700

    Fix lazy translation UnicodeErrors

    upload_utils is concatenating str and Message objects which doesn't work
    on python 2, so change the str to a unicode object.

    test_quota.py was casting Message objects to str which fails for the
    same reason, so rather than cast to str, cast using six.text_type.

    See oslo commit 2cfc1a78d8063cf20083cf7df796d730a576551c for history and
    details on why the Message object doesn't support __str__ casting.

    This is a small part of a larger effort that the oslo team will be
    rolling out with graduation and adoption of the oslo-i18n library.

    Closes-Bug: #1334774

    Change-Id: I9d3f29c661f1afffabbbbb499f48d37ef5a8fcee

Changed in glance:
status: In Progress → Fix Committed
Changed in glance:
milestone: none → juno-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/109231

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/icehouse)

Reviewed: https://review.openstack.org/109231
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=55086530521435cdf811686fa73de250169165e9
Submitter: Jenkins
Branch: stable/icehouse

commit 55086530521435cdf811686fa73de250169165e9
Author: Matt Riedemann <email address hidden>
Date: Thu Jun 26 11:59:08 2014 -0700

    Fix lazy translation UnicodeErrors

    upload_utils is concatenating str and Message objects which doesn't work
    on python 2, so change the str to a unicode object.

    test_quota.py was casting Message objects to str which fails for the
    same reason, so rather than cast to str, cast using six.text_type.

    See oslo commit 2cfc1a78d8063cf20083cf7df796d730a576551c for history and
    details on why the Message object doesn't support __str__ casting.

    This is a small part of a larger effort that the oslo team will be
    rolling out with graduation and adoption of the oslo-i18n library.

    Closes-Bug: #1334774

    Conflicts:
     glance/api/v1/upload_utils.py
     glance/tests/unit/test_quota.py

    Change-Id: I9d3f29c661f1afffabbbbb499f48d37ef5a8fcee
    (cherry picked from commit 834e1f2150c6f2afd92036e6b7f53afee4006682)

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in glance:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.