MCPcopy Create free account
hub / github.com/conda/constructor / _read_briefcase_log_tail

Function _read_briefcase_log_tail

tests/test_examples.py:369–382  ·  view source on GitHub ↗

Helper function to read logs from installers created with briefcase. The encoding can vary between the different logs.

(path: Path, last_digits: int)

Source from the content-addressed store, hash-verified

367
368
369def _read_briefcase_log_tail(path: Path, last_digits: int) -> str:
370 """Helper function to read logs from installers created with briefcase.
371 The encoding can vary between the different logs.
372 """
373 if not path or not path.exists():
374 return f"(log not found: {path})"
375
376 # Try UTF-16 first (MSI logs), fallback to UTF-8
377 try:
378 text = path.read_text(encoding="utf-16", errors="replace")
379 except UnicodeError:
380 text = path.read_text(encoding="utf-8", errors="replace")
381
382 return text[last_digits:]
383
384
385@dataclass

Callers 2

read_textMethod · 0.85
read_textMethod · 0.85

Calls 1

read_textMethod · 0.45

Tested by

no test coverage detected