[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

Michael Osipov report at bugs.python.org
Sat Aug 25 16:17:09 EDT 2018


Michael Osipov <1983-01-06 at gmx.net> added the comment:

I think you are absoltely right.

> In any case, it seems to be broken for any system that does not have UTF-8 as default.

You likely mean ASCII. Python assumes that LANG=C is ASCII which is not the case for AIX and HP-UX.

Your patch looks reasonable, I will try this on Monday. The problem is that there is no roman8 codec in Python. Maybe ISO-8859-1 will do it for the test, but I am still eager to add one.

> I mention this because it seems neither roman8 nor roman9 have 'official' iso names or alias (correct me if I am wrong).

There are no ISO names because this is not an ISO encoding. This is an HP invention aka hp-roman8 (roman8, ibm-1051, r8, Cp1051).

Edit: there is roman8 support: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Lib/encodings/hp_roman8.py as well as aliases.

There are a few aliases missing: cp1051, ibm1051 and hp-roman8. This needs an additonal PR.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34403>
_______________________________________


More information about the Python-bugs-list mailing list