mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
fix(tools): write run_job_manager_reference output as UTF-8
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
99791c5c5d
commit
d2aa697b91
2 files changed
+18
No files matched your search
@@ -134,6 +134,9 @@ def run(args, directory):
|
||||
|
||||
|
||||
def main():
|
||||
for stream in (sys.stdout, sys.stderr):
|
||||
if hasattr(stream, "reconfigure"):
|
||||
stream.reconfigure(encoding="utf-8", errors="backslashreplace")
|
||||
parser = argparse.ArgumentParser(description="Run the CPU JobManager fixtures through native relinker startup using an owned module or the host fallback.")
|
||||
provider = parser.add_mutually_exclusive_group(required=True)
|
||||
provider.add_argument("--module", type=Path, help="Owned decrypted SELF or ELF libSceJobManager.prx")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import contextlib
|
||||
import io
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -90,6 +92,19 @@ class ReferenceErrorTests(unittest.TestCase):
|
||||
self.assertEqual(code, 0, error)
|
||||
self.assertEqual(error, "")
|
||||
|
||||
def test_an_artifact_path_outside_the_output_encoding_is_printed(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
build = root / "build"
|
||||
build.mkdir()
|
||||
artifact = root / "вывод"
|
||||
result = subprocess.run([sys.executable, runner.__file__, "--host", "--build", str(build), "--relinker", sys.executable,
|
||||
"--toolchain", str(build), "--output", str(artifact)],
|
||||
capture_output=True, encoding="utf-8", timeout=20, env={**os.environ, "PYTHONIOENCODING": "ascii"})
|
||||
self.assertEqual(result.returncode, 2, result.stderr)
|
||||
self.assertIn(f"Artifacts: {artifact.resolve()}", result.stdout)
|
||||
self.assertIn("Build the job_manager_reference target first", result.stderr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user