Message objects do not support str() because they may contain non-ascii characters

Bug #1495100 reported by Oleksii Chuprykov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Expired
Undecided
Unassigned

Bug Description

Many py27 gates failed with the following message: UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.

2015-09-11 20:15:40.679 | Traceback (most recent call last):
2015-09-11 20:15:40.679 | File "/home/jenkins/workspace/gate-sahara-python27/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
2015-09-11 20:15:40.679 | return func(*args, **keywargs)
2015-09-11 20:15:40.679 | File "/home/jenkins/workspace/gate-sahara-python27/sahara/tests/unit/utils/openstack/test_images.py", line 41, in test_list_registered_images
2015-09-11 20:15:40.679 | nova = nova_client.client()
2015-09-11 20:15:40.679 | File "sahara/utils/openstack/nova.py", line 49, in client
2015-09-11 20:15:40.679 | endpoint_type=CONF.nova.endpoint_type)
2015-09-11 20:15:40.679 | File "/home/jenkins/workspace/gate-sahara-python27/.tox/py27/local/lib/python2.7/site-packages/novaclient/v2/client.py", line 109, in __init__
2015-09-11 20:15:40.680 | _LW("'novaclient.v2.client.Client' is not designed to be "
2015-09-11 20:15:40.680 | File "/home/jenkins/workspace/gate-sahara-python27/.tox/py27/lib/python2.7/warnings.py", line 29, in _show_warning
2015-09-11 20:15:40.680 | file.write(formatwarning(message, category, filename, lineno, line))
2015-09-11 20:15:40.680 | File "/home/jenkins/workspace/gate-sahara-python27/.tox/py27/lib/python2.7/warnings.py", line 38, in formatwarning
2015-09-11 20:15:40.680 | s = "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
2015-09-11 20:15:40.680 | File "/home/jenkins/workspace/gate-sahara-python27/.tox/py27/local/lib/python2.7/site-packages/oslo_i18n/_message.py", line 223, in __str__
2015-09-11 20:15:40.680 | raise UnicodeError(msg)
2015-09-11 20:15:40.680 | UnicodeError: Message objects do not support str() because they may contain non-ascii characters. Please use unicode() or translate() instead.

Root cause is this deprecation messages: https://github.com/openstack/python-novaclient/blob/master/novaclient/client.py#L784
https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/client.py#L108-L112

Probably we shouldn't call warnings.warn() with translated messages.

melanie witt (melwitt)
Changed in python-novaclient:
importance: Undecided → High
status: New → Confirmed
Ammar Raza (ammar-reza)
Changed in python-novaclient:
assignee: nobody → Ammar Raza (ammar-reza)
Ali Jabbar (jabbar-ali)
Changed in python-novaclient:
status: Confirmed → In Progress
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

This bug has been open about 3 years without any activity.
And I'm not sure this bug can be reproduced with current master branch.
So I'm going to move it to "Opinion / Wishlist", which is an easily-obtainable queue of older requests that have come on.
This bug can be reopened (set back to "New") if someone can reproduce this bug on master branch or decides to work on this.

Changed in python-novaclient:
status: In Progress → Opinion
importance: High → Wishlist
assignee: Ammar Raza (ammar-reza) → nobody
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

Set this bug to 'Incomplete / Undecided'.

Changed in python-novaclient:
status: Opinion → Incomplete
importance: Wishlist → Undecided
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-novaclient because there has been no activity for 60 days.]

Changed in python-novaclient:
status: Incomplete → Expired
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.