MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / _write_text_cache

Function _write_text_cache

src/services/browser_captcha_personal.py:1099–1105  ·  view source on GitHub ↗

Atomically write UTF-8 text content into the cache.

(cache_path: Path, content: str)

Source from the content-addressed store, hash-verified

1097
1098
1099def _write_text_cache(cache_path: Path, content: str):
1100 """Atomically write UTF-8 text content into the cache."""
1101 cache_path.parent.mkdir(parents=True, exist_ok=True)
1102 temp_path = cache_path.with_suffix(f"{cache_path.suffix}.part")
1103 with open(temp_path, "w", encoding="utf-8", newline="\n") as f:
1104 f.write(content)
1105 os.replace(temp_path, cache_path)
1106
1107
1108def _get_recaptcha_asset_cache_dir() -> Path:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected