From b7b15bd3936051b03724eb015b6aa5fc06636f4a Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Sat, 15 Feb 2025 13:25:18 +0800 Subject: [PATCH 1/2] fix code page error in non-English systems --- fs/bin/add_build_info.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/bin/add_build_info.py b/fs/bin/add_build_info.py index 4e9ba02fe6..db9de664c5 100755 --- a/fs/bin/add_build_info.py +++ b/fs/bin/add_build_info.py @@ -9,13 +9,12 @@ import datetime from shutil import which -from subprocess import Popen, PIPE, STDOUT, getstatusoutput +from subprocess import Popen, PIPE, STDOUT, getstatusoutput, run from typing import Any from collections.abc import Sequence import socket import platform import os.path -import re import sys @@ -171,11 +170,18 @@ def get_platform_name() -> str: return "OpenBSD" if sys.platform.startswith("win"): try: - out = Popen('systeminfo', stdout=PIPE, text=True).communicate()[0] - match = re.search(r"OS Name:\s*(.*)", out) - if match: - return match.group(1).strip() - return "Windows unknown" + out = run( + [ + "powershell", + "-NoProfile", + "-Command", + "$OutputEncoding = [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding; (Get-CimInstance Win32_OperatingSystem).Caption | Out-String", + ], + capture_output=True, + text=True, + encoding="utf-8", + ).stdout.strip() + return out except OSError: pass return "Microsoft Windows" From 42f434c38ee6ce188d35ac453d21d2acb4a37dae Mon Sep 17 00:00:00 2001 From: timsu92 <33785401+timsu92@users.noreply.github.com> Date: Sat, 15 Feb 2025 14:02:17 +0800 Subject: [PATCH 2/2] fix package name typo --- packaging/MSWindows/SETUP.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/MSWindows/SETUP.sh b/packaging/MSWindows/SETUP.sh index 6773c882e2..a7d37269ba 100644 --- a/packaging/MSWindows/SETUP.sh +++ b/packaging/MSWindows/SETUP.sh @@ -30,7 +30,7 @@ for x in cryptography cffi pycparser numpy pillow appdirs paramiko comtypes neti $PACMAN ${XPKG}python-${x} done #not yet available for aarch64?: -for x in cx-Freeze gssapi; do +for x in cx-freeze gssapi; do $PACMAN ${XPKG}python-${x} done