MCPcopy Index your code
hub / github.com/github/copilot-sdk / _sanitize_version

Function _sanitize_version

python/copilot/_cli_download.py:44–50  ·  view source on GitHub ↗

Sanitize version string for use as a directory name. Replaces any character not in [a-zA-Z0-9._-] with underscore. Matches the Rust SDK's sanitization logic.

(version: str)

Source from the content-addressed store, hash-verified

42
43
44def _sanitize_version(version: str) -> str:
45 """Sanitize version string for use as a directory name.
46
47 Replaces any character not in [a-zA-Z0-9._-] with underscore.
48 Matches the Rust SDK's sanitization logic.
49 """
50 return re.sub(r"[^a-zA-Z0-9._\-]", "_", version)
51
52
53def get_cache_dir(version: str | None = None) -> Path:

Callers 1

get_cache_dirFunction · 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…