mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #8965: Add a regression test to test_sys with LANG=C
This commit is contained in:
parent
9e19ca42d3
commit
2690461a9e
1 changed files with 13 additions and 2 deletions
|
@ -863,10 +863,21 @@ class SizeofTest(unittest.TestCase):
|
|||
# sys.flags
|
||||
check(sys.flags, size(vh) + self.P * len(sys.flags))
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'darwin', "test specific to Mac OS X")
|
||||
def test_getfilesystemencoding(self):
|
||||
# On Darwing FS encoding is always UTF-8
|
||||
fs_encoding = sys.getfilesystemencoding()
|
||||
if sys.platform == 'darwin':
|
||||
self.assertEqual(fs_encoding, 'utf-8')
|
||||
self.assertEqual(fs_encoding, 'utf-8')
|
||||
|
||||
# Even in C locale
|
||||
env = os.environ.copy()
|
||||
env['LANG'] = 'C'
|
||||
output = subprocess.check_output(
|
||||
[sys.executable, "-c",
|
||||
"import sys; print(sys.getfilesystemencoding())"],
|
||||
env=env)
|
||||
fs_encoding = output.rstrip()
|
||||
self.assertEqual(fs_encoding, b'utf-8')
|
||||
|
||||
def test_setfilesystemencoding(self):
|
||||
old = sys.getfilesystemencoding()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue