Quantum xml doesn't work with unicode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
High
|
Alex Xu |
Bug Description
When enable Chinese translation file and raise an exception that translated by Chinese will get exception as below:
Traceback (most recent call last):
File "/usr/local/
result = self.applicatio
File "/usr/lib/
return app(environ, start_response)
File "/usr/local/
return self.app(env, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/lib/
response = self.app(environ, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/lib/
response = self.app(environ, start_response)
File "/usr/local/
return resp(environ, start_response)
File "/usr/local/
resp = self.call_func(req, *args, **self.kwargs)
File "/usr/local/
return self.func(req, *args, **kwargs)
File "/home/
body = serializer.
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)
How to reproduce:
1. initialize or update template to chinese template
initialize:
python ./setup.py init_catalog -l zh_CN -i quantum/
update:
python ./setup.py update_catalog -l zh_CN -i quantum/
2. Translate a message of exception that you want to raise. There is chinese for test '中文中文'
3. compile catalog
python ./setup.py compile_catalog --directory quantum/locale --locale zh_CN
4. cp quantum/
5. running quantum with env varables: LANGUAGE=zh_CN:zh LANG=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8
6. then use quantum cli tools to raise the error that you have translated.
Changed in quantum: | |
assignee: | nobody → Alex Xu (xuhj) |
Changed in quantum: | |
importance: | Undecided → High |
milestone: | none → havana-1 |
description: | updated |
description: | updated |
description: | updated |
tags: | added: quantum-core |
tags: | added: grizzly-backport-potential |
Changed in quantum: | |
milestone: | havana-1 → grizzly-rc3 |
Changed in quantum: | |
milestone: | grizzly-rc3 → 2013.1 |
tags: | removed: grizzly-backport-potential |
Fix proposed to branch: master /review. openstack. org/25482
Review: https:/