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

Function _sanitize_params

Lib/tempfile.py:115–130  ·  view source on GitHub ↗

Common parameter processing for most APIs in this module.

(prefix, suffix, dir)

Source from the content-addressed store, hash-verified

113
114
115def _sanitize_params(prefix, suffix, dir):
116 """Common parameter processing for most APIs in this module."""
117 output_type = _infer_return_type(prefix, suffix, dir)
118 if suffix is None:
119 suffix = output_type()
120 if prefix is None:
121 if output_type is str:
122 prefix = template
123 else:
124 prefix = _os.fsencode(template)
125 if dir is None:
126 if output_type is str:
127 dir = gettempdir()
128 else:
129 dir = gettempdirb()
130 return prefix, suffix, dir, output_type
131
132
133class _RandomNameSequence:

Callers 4

mkstempFunction · 0.85
mkdtempFunction · 0.85
NamedTemporaryFileFunction · 0.85
TemporaryFileFunction · 0.85

Calls 3

_infer_return_typeFunction · 0.85
gettempdirFunction · 0.85
gettempdirbFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…