[issue23195] Sorting with locale does not work properly with Python3 on Macos

2015-01-08 Thread STINNER Victor
STINNER Victor added the comment: locale.strxfrm() have a different implementation in Python 2 and in Python 3: - Python 2 uses strxfrm(), so works on bytes strings - Python 3 uses wcsxfrm(), so works on multibyte strings ("unicode" strings) It looks like Python 2 and 3 have the same behaviour o

[issue23195] Sorting with locale does not work properly with Python3 on Macos

2015-01-08 Thread Ned Deily
Changes by Ned Deily : -- nosy: +ned.deily ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue23195] Sorting with locale does not work properly with Python3 on Macos

2015-01-08 Thread Pierre Nugues
New submission from Pierre Nugues: The sorted() function does not work properly with macosx. Here is a script to reproduce the issue: import locale locale.setlocale(locale.LC_ALL, "fr_FR.UTF-8") a = ["A", "E", "Z", "a", "e", "é", "z"] sorted(a) sorted(a, key=locale.strxfrm) The execution on Ma