unicode characters are not being handled properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-ironicclient |
In Progress
|
Medium
|
Vadim Hmyrov |
Bug Description
Dictionaries are displayed as Python literals in ironic node properties. Instead of being properly printed to the standard output stream.
It causes issues when displaying a non-ASCII characters in the properties names/values.
Look for example in paste: http://
Usage of Unicode characters can affect execution of next CLI commands.
Also it is harder to read large metadata, when it all printed in quotes and with "u" prefixes:
http://
VERSION:
feature_groups:
- mirantis
production: "docker"
release: "8.0"
openstack_
api: "1.0"
build_number: "236"
build_id: "2015-10-
fuel-nailgun_sha: "ece438cbd9919c
python-
fuel-agent_sha: "5d2d5e2e9ad4f8
fuel-
astute_sha: "a090546d43c770
fuel-library_sha: "bf572ec8ea272b
fuel-ostf_sha: "92afc66afc9d21
fuel-
fuelmain_sha: "9896d379981ea5
python-ironicclient version: 0.5.1
Changed in mos: | |
status: | New → Confirmed |
importance: | Medium → Low |
affects: | mos → ironic |
Changed in ironic: | |
milestone: | 8.0 → none |
affects: | ironic → python-ironicclient |
tags: | removed: ironic |
Changed in python-ironicclient: | |
assignee: | MOS Ironic (mos-ironic) → Vadim Hmyrov (vhmyrov) |
Changed in python-ironicclient: | |
status: | Confirmed → In Progress |
Hi Kyrylo!
I believe we could get rid of 'u' Python literals, but general fix for Unicode characters representation in the properties which are objects is not trivial.
This issue should affect all other Openstack CLI clients as well, at least those that are running on Py2. Because on 'C' level printing of objects using `_repr_` method and it works differently on Py2 and Py3.
The roots of this problem described in the pep-3138 (https:/ /www.python. org/dev/ peps/pep- 3138/) and fixed by patch for Py3 (http:// bugs.python. org/issue2630).
Hope somebody could correct me if I have made wrong investigation.
What we might do:
1. display such properties as lines of rows in format "key: value" or manually prepare the output string that will looks like a dict
2. try to reuse patched _repr_ in Py2
3. add dependency on some module that already fixing this problem
First one looks safer for me..