File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515)
1616
1717# Set the list of ways we expect to be able to ask for the "C" locale
18- EXPECTED_C_LOCALE_EQUIVALENTS = ["C" , "invalid.ascii" ]
18+ EXPECTED_C_LOCALE_EQUIVALENTS = ["C" , "invalid.ascii" , "POSIX" ]
1919
2020# Set our expectation for the default encoding used in the C locale
2121# for the filesystem encoding and the standard streams
3131 # Android defaults to using UTF-8 for all system interfaces
3232 EXPECTED_C_LOCALE_STREAM_ENCODING = "utf-8"
3333 EXPECTED_C_LOCALE_FS_ENCODING = "utf-8"
34- else :
35- # Linux distros typically alias the POSIX locale directly to the C
36- # locale.
37- # TODO: Once https://bugs.python.org/issue30672 is addressed, we'll be
38- # able to check this case unconditionally
39- EXPECTED_C_LOCALE_EQUIVALENTS .append ("POSIX" )
4034elif sys .platform .startswith ("aix" ):
4135 # AIX uses iso8859-1 in the C locale, other *nix platforms use ASCII
4236 EXPECTED_C_LOCALE_STREAM_ENCODING = "iso8859-1"
5347# Note that the above expectations are still wrong in some cases, such as:
5448# * Windows when PYTHONLEGACYWINDOWSFSENCODING is set
5549# * Any platform other than AIX that uses latin-1 in the C locale
56- # * Any Linux distro where POSIX isn't a simple alias for the C locale
5750# * Any Linux distro where the default locale is something other than "C"
5851#
5952# Options for dealing with this:
You can’t perform that action at this time.
0 commit comments