[issue23637] Warnings error with non-ascii chars.

Lukáš Němec report at bugs.python.org
Wed Mar 11 09:35:04 CET 2015


New submission from Lukáš Němec:

File "/usr/lib/python2.7/warnings.py", line 29, in _show_warning
    file.write(formatwarning(message, category, filename, lineno, line))
  File "/usr/lib/python2.7/warnings.py", line 38, in formatwarning
    s =  "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 42: ordinal not in range(128)

Only thing required to make this work is add "u" in front of the message so it is unicode. This will work for all ascii characters and all non-ascii should pass unicode anyway.

----------
components: Library (Lib)
messages: 237850
nosy: Lukáš.Němec
priority: normal
severity: normal
status: open
title: Warnings error with non-ascii chars.
type: crash
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23637>
_______________________________________


More information about the Python-bugs-list mailing list