MCPcopy Index your code
hub / github.com/python/cpython / fsdecode

Function fsdecode

Lib/os.py:882–892  ·  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

880 return filename
881
882 def fsdecode(filename):
883 """Decode filename (an os.PathLike, bytes, or str) from the filesystem
884 encoding with 'surrogateescape' error handler, return str unchanged. On
885 Windows, use 'strict' error handler if the file system encoding is
886 'mbcs' (which is the default encoding).
887 """
888 filename = fspath(filename) # Does type-checking of `filename`.
889 if isinstance(filename, bytes):
890 return filename.decode(encoding, errors)
891 else:
892 return filename
893
894 return fsencode, fsdecode
895

Callers 1

get_exec_pathFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…