classification
Title: In some envrionment using unicode, formatwarning shows ascii error
Type: Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, xtrusia
Priority: normal Keywords: patch

Created on 2018-04-04 23:31 by xtrusia, last changed 2018-04-05 01:30 by xtrusia. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6377 closed python-dev, 2018-04-04 23:38
Messages (1)
msg314961 - (view) Author: Seyeong Kim (xtrusia) Date: 2018-04-04 23:31
In some circumstances using unicode, formatwarning show me ascii error

so I should prefix on below line to remove this crash
s =  "%s: %s: %s\n" % (lineno, category.__name__, message)
to
s =  u"%s: %s: %s\n" % (lineno, category.__name__, message)

below are logs

Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 144, in __call__
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     return resp(environ, start_response)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     resp = self.call_func(req, *args, **self.kwargs)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     return self.func(req, *args, **kwargs)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/api/openstack/wsgi.py", line 1061, in __call__
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     content_type, body, accept)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/api/openstack/wsgi.py", line 1123, in _process_stack
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     action_result = self.dispatch(meth, request, action_args)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/api/openstack/wsgi.py", line 1221, in dispatch
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     return method(req=request, **action_args)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/api/v2/volumes.py", line 405, in create
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     **kwargs)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/volume/api.py", line 327, in create
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     flow_engine.run()
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 230, in run
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     for _state in self.run_iter(timeout=timeout):
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 308, in run_iter
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     failure.Failure.reraise_if_any(fails)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/taskflow/types/failure.py", line 336, in reraise_if_any
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     failures[0].reraise()
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/taskflow/types/failure.py", line 343, in reraise
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     six.reraise(*self._exc_info)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 82, in _execute_task
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     result = task.execute(**arguments)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/volume/flows/api/create_volume.py", line 527, in execute
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     volume = objects.Volume(context=context, **volume_properties)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/cinder/objects/volume.py", line 180, in __init__
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     super(Volume, self).__init__(*args, **kwargs)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 304, in __init__
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     setattr(self, key, kwargs[key])
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/base.py", line 72, in setter
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     field_value = field.coerce(self, name, value)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 192, in coerce
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     return self._type.coerce(obj, attr, value)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/dist-packages/oslo_versionedobjects/fields.py", line 325, in coerce
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     u"for further details" % value, FutureWarning)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/logging/__init__.py", line 1724, in _showwarning
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     s = warnings.formatwarning(message, category, filename, lineno, line)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault   File "/usr/lib/python2.7/warnings.py", line 50, in formatwarning
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault     s =  "%s: %s: %s\n" % (lineno, category.__name__, message)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault UnicodeEncodeError: 'ascii' codec can't encode character u'\u0101' in position 1: ordinal not in range(128)
Apr  4 22:22:44 juju-7a19d0-0-lxd-0 cinder-api[5302]: 2018-04-04 22:22:44.441 5316 ERROR cinder.api.middleware.fault
History
Date User Action Args
2018-04-05 01:30:59xtrusiasetstatus: open -> closed
resolution: wont fix
stage: patch review -> resolved
2018-04-04 23:46:16ned.deilysetnosy: + serhiy.storchaka
type: crash ->
2018-04-04 23:38:18python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request6089
2018-04-04 23:31:07xtrusiacreate