[issue24848] Warts in UTF-7 error handling

Serhiy Storchaka report at bugs.python.org
Thu Oct 8 11:56:00 EDT 2015


Serhiy Storchaka added the comment:

The difference between 2.7 and 3.x is that 2.7 uses isalnum() in IS_BASE64, and 3.x test concrete ranges. Therefore depending on platform and locale 2.7 can accept wrong bytes as BASE64 characters and return incorrect result. Following patch makes 2.7 code the same as 3.x. Tests are changed to fail with large probability with unpatched code ('\xe1' is an alnum on almost all 8-bit locales).

----------
Added file: http://bugs.python.org/file40719/decode_utf7_locale-2.7.patch

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


More information about the Python-bugs-list mailing list