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

Function encode

Lib/os.py:805–808  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

803 # Where Env Var Names Can Be Mixed Case
804 encoding = sys.getfilesystemencoding()
805 def encode(value):
806 if not isinstance(value, str):
807 raise TypeError("str expected, not %s" % type(value).__name__)
808 return value.encode(encoding, 'surrogateescape')
809 def decode(value):
810 return value.decode(encoding, 'surrogateescape')
811 encodekey = encode

Callers 1

encodekeyFunction · 0.70

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…