summaryrefslogtreecommitdiff
path: root/Lib/os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py5
1 files changed, 1 insertions, 4 deletions
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