From cc16be85c0b7119854c00fb5c666825deef641cf Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 8 Sep 2016 10:35:16 -0700 Subject: Issue #27781: Change file system encoding on Windows to UTF-8 (PEP 529) --- Lib/os.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Lib/os.py') diff --git a/Lib/os.py b/Lib/os.py index 10d70ada4d..7379dad41a 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -851,10 +851,7 @@ if supports_bytes_environ: def _fscodec(): encoding = sys.getfilesystemencoding() - if encoding == 'mbcs': - errors = 'strict' - else: - errors = 'surrogateescape' + errors = sys.getfilesystemencodeerrors() def fsencode(filename): """Encode filename (an os.PathLike, bytes, or str) to the filesystem -- cgit v1.2.1