)]}'
{"test/unit/test_locale/test_locale.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"64358a2993fc26f5654dd3fc110d9655237571fc","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def test_translations(self):"},{"line_number":43,"context_line":"        path \u003d \u0027:\u0027.join(sys.path)"},{"line_number":44,"context_line":"        translated_message \u003d check_output([\u0027python\u0027, __file__, path])"},{"line_number":45,"context_line":"        self.assertEqual(translated_message, u\u0027prova mesaĝo\\n\u0027.encode(\u0027utf-8\u0027))"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_c11f98b4","line":44,"updated":"2019-06-14 20:30:59.000000000","message":":-( So on py36, the subprocess seems to fall back to using US-ASCII for stdout. I think it comes down to what locales are available on the system? Based on what I saw in CPython\u0027s source [0] I started playing around with some simple C code and seeing what encodings I could get:\n\n#include \u003clanginfo.h\u003e\n#include \u003clocale.h\u003e\n#include \u003cstdio.h\u003e\nint main(int argc, char **argv){\n    setlocale(LC_ALL, \"\");\n    printf(\"%s\\n\", nl_langinfo(CODESET));\n    return 0;\n}\n\nCompile and run it with a fresh env and I get\n\n $ env -i ./a.out \n ANSI_X3.4-1968\n\nSet LC_ALL:\n\n $ env -i LC_ALL\u003deo ./a.out \n UTF-8\n\nBut those were both on my laptop which has eo as a locale:\n\n $ locale -a | grep eo\n eo\n eo.utf8\n ka_GE.georgianps\n\nOn another box that *doesn\u0027t*:\n\n $ locale -a | grep eo\n ka_GE.georgianps\n\n $ env -i ./a.out \n ANSI_X3.4-1968\n\n $ env -i LC_ALL\u003deo ./a.out \n ANSI_X3.4-1968\n\n $ env -i LC_ALL\u003dfr_FR.UTF-8 ./a.out \n UTF-8\n\nI *think* py37 resolved this in https://www.python.org/dev/peps/pep-0540/\n\n[0] See\n\n- https://github.com/python/cpython/blob/v3.6.8/Lib/locale.py#L631-L644 which calls\n- https://github.com/python/cpython/blob/v3.6.8/Lib/_bootlocale.py#L23-L34\n\nI also peeked at some sys module code like\n\n- https://github.com/python/cpython/blob/v3.6.8/Python/sysmodule.c#L296-L304 that uses vars initialized in\n- https://github.com/python/cpython/blob/v3.6.8/Python/pylifecycle.c#L981-L1021 which calls\n- https://github.com/python/cpython/blob/v3.6.8/Python/pylifecycle.c#L225-L245","commit_id":"ff950cc00adda06cf1721df9afc8a0ca7e4d94b4"}]}
