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

Function _make_filename

Lib/multiprocessing/shared_memory.py:40–47  ·  view source on GitHub ↗

Create a random filename for the shared memory object.

()

Source from the content-addressed store, hash-verified

38
39
40def _make_filename():
41 "Create a random filename for the shared memory object."
42 # number of random bytes to use for name
43 nbytes = (_SHM_SAFE_NAME_LENGTH - len(_SHM_NAME_PREFIX)) // 2
44 assert nbytes >= 2, '_SHM_NAME_PREFIX too long'
45 name = _SHM_NAME_PREFIX + secrets.token_hex(nbytes)
46 assert len(name) <= _SHM_SAFE_NAME_LENGTH
47 return name
48
49
50class SharedMemory:

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…