mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-11-02 13:12:50 +00:00
fix(upstream): use UTF-8 for framework version checks (#587)
* fix(upstream): use UTF-8 for framework version checks * test(upstream): isolate argument and console codecs * docs(changelog): record fix for #587 * changelog: place the #587 entry under [Unreleased] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
3 files changed
+55
-1
No files matched your search
@@ -38,7 +38,10 @@ FRAMEWORK_FILES = [
|
||||
UPSTREAM_REPO_SLUG = "MadsLorentzen/ai-job-search"
|
||||
|
||||
def run_git(args: list[str]) -> tuple[int, str, str]:
|
||||
res = subprocess.run(["git"] + args, cwd=str(ROOT), capture_output=True, text=True)
|
||||
res = subprocess.run(
|
||||
["git"] + args, cwd=str(ROOT), capture_output=True, text=True,
|
||||
encoding="utf-8", errors="replace",
|
||||
)
|
||||
return res.returncode, res.stdout, res.stderr
|
||||
|
||||
def get_remote_url(remote_name: str) -> str:
|
||||
@@ -65,7 +68,16 @@ def parse_semver(version_str: str) -> tuple[int, int, int]:
|
||||
return (0, 0, 0)
|
||||
return tuple(int(x) for x in match.groups())
|
||||
|
||||
def _force_utf8_output() -> None:
|
||||
"""Use UTF-8 for piped output even on legacy-console hosts."""
|
||||
for stream in (sys.stdout, sys.stderr):
|
||||
reconfigure = getattr(stream, "reconfigure", None)
|
||||
if reconfigure:
|
||||
reconfigure(encoding="utf-8")
|
||||
|
||||
|
||||
def main() -> int:
|
||||
_force_utf8_output()
|
||||
parser = argparse.ArgumentParser(description="Check for framework updates upstream.")
|
||||
parser.add_argument("--remote", default="upstream", help="Name of the git remote for upstream (default: upstream)")
|
||||
parser.add_argument("--branch", default="master", help="Branch name of the upstream repo (default: master)")
|
||||
|
||||
Reference in new issue
Block a user