[pypy-issue] [issue886] unicode.translate behavior differs from CPython
Andrew Mahone
tracker at bugs.pypy.org
Wed Sep 28 08:20:17 CEST 2011
New submission from Andrew Mahone <andrew.mahone at gmail.com>:
CPython's unicode.translate will actually work with lists, tuples, and strings
as well as dicts, retaining the advertised behavior with regard to elements not
in the translation mapping. On pypy, if an exception other than KeyError is
raised on lookup, translate raises an exception, rather than leaving the
character unchanged. This patch adds a test for the CPython behavior, and fixes
it by treating IndexError on lookup identically to KeyError.
----------
files: unicode_translate.patch
messages: 3204
nosy: pypy-issue
priority: bug
status: unread
title: unicode.translate behavior differs from CPython
________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue886>
________________________________________
More information about the pypy-issue
mailing list