MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / fsdecode

Function fsdecode

tools/python-3.11.9-amd64/Lib/os.py:818–828  ·  view source on GitHub ↗

Decode filename (an os.PathLike, bytes, or str) from the filesystem encoding with 'surrogateescape' error handler, return str unchanged. On Windows, use 'strict' error handler if the file system encoding is 'mbcs' (which is the default encoding).

(filename)

Source from the content-addressed store, hash-verified

816 return filename
817
818 def fsdecode(filename):
819 """Decode filename (an os.PathLike, bytes, or str) from the filesystem
820 encoding with 'surrogateescape' error handler, return str unchanged. On
821 Windows, use 'strict' error handler if the file system encoding is
822 'mbcs' (which is the default encoding).
823 """
824 filename = fspath(filename) # Does type-checking of `filename`.
825 if isinstance(filename, bytes):
826 return filename.decode(encoding, errors)
827 else:
828 return filename
829
830 return fsencode, fsdecode
831

Callers 1

get_exec_pathFunction · 0.70

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected