Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(tests): decode CLI subprocess output as UTF-8 regardless of the parent locale

hugohe37879bbc811f8
diff --git a/skills/ppt-master/scripts/tests/test_audit_r3_native_images.py b/skills/ppt-master/scripts/tests/test_audit_r3_native_images.py
index 7bc06c3e..4db8895a 100644
--- a/skills/ppt-master/scripts/tests/test_audit_r3_native_images.py
+++ b/skills/ppt-master/scripts/tests/test_audit_r3_native_images.py
@@ -401,7 +401,7 @@ class NativeTableMixedRunAuditTests(unittest.TestCase):
for script, *arguments in commands:
result = subprocess.run(
[sys.executable, "-B", str(scripts / script), *arguments],
- capture_output=True, text=True, check=False,
+ capture_output=True, text=True, encoding="utf-8", errors="replace", check=False,
)
results.append(result)
for result in results[:2]:
diff --git a/skills/ppt-master/scripts/tests/test_audit_r3_typography.py b/skills/ppt-master/scripts/tests/test_audit_r3_typography.py
index 217890c3..73edc11b 100644
--- a/skills/ppt-master/scripts/tests/test_audit_r3_typography.py
+++ b/skills/ppt-master/scripts/tests/test_audit_r3_typography.py
@@ -272,7 +272,7 @@ class IncrementalCalibrationTests(unittest.TestCase):
result = subprocess.run(
[sys.executable, "-B", str(SCRIPTS_DIR / "text_measure.py"),
"calibrate", str(project), *options],
- capture_output=True, text=True, check=False,
+ capture_output=True, text=True, encoding="utf-8", errors="replace", check=False,
)
self.assertEqual(result.returncode, 0, result.stderr)
return result
diff --git a/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py b/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
index 9749dfe5..354d0dc0 100644
--- a/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
+++ b/skills/ppt-master/scripts/tests/test_dogfood_leaves_fixes.py
@@ -129,6 +129,7 @@ class PdfClauseAndScanTests(unittest.TestCase):
class ImportSourcesProjectTreeTests(unittest.TestCase):
def test_research_web_sources_dir_is_not_a_project(self) -> None:
+ PROJECTS_ROOT.mkdir(parents=True, exist_ok=True)
with tempfile.TemporaryDirectory(dir=PROJECTS_ROOT) as tmp:
root = Path(tmp)
scratch = root.with_name(root.name + "_web_sources")
diff --git a/skills/ppt-master/scripts/tests/test_slice_images.py b/skills/ppt-master/scripts/tests/test_slice_images.py
index 6b41922a..4d0fc855 100644
--- a/skills/ppt-master/scripts/tests/test_slice_images.py
+++ b/skills/ppt-master/scripts/tests/test_slice_images.py
@@ -120,6 +120,8 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
],
capture_output=True,
text=True,
+ encoding="utf-8",
+ errors="replace",
check=False,
)
@@ -163,6 +165,8 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
],
capture_output=True,
text=True,
+ encoding="utf-8",
+ errors="replace",
check=False,
)
@@ -203,7 +207,7 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
"--bg", "#0000FF", "--inset", "0,0.06",
"--output", str(output_dir),
],
- capture_output=True, text=True, check=False,
+ capture_output=True, text=True, encoding="utf-8", errors="replace", check=False,
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(Image.open(output_dir / "a.png").size, (381, 33))
@@ -230,7 +234,7 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
]
result = subprocess.run(
args + ["--bg", "#0000FF", "--tolerance", "62"],
- capture_output=True, text=True, check=False,
+ capture_output=True, text=True, encoding="utf-8", errors="replace", check=False,
)
self.assertEqual(result.returncode, 1)
self.assertIn("semi-transparent", result.stderr)
@@ -239,7 +243,7 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
result = subprocess.run(
args + ["--bg", "#034AF4", "--tolerance", "62"],
- capture_output=True, text=True, check=False,
+ capture_output=True, text=True, encoding="utf-8", errors="replace", check=False,
)
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(Image.open(output_dir / "mark.png").size, (41, 41))
@@ -267,7 +271,7 @@ class SliceImagesDiagnosticsTests(unittest.TestCase):
"--bg", "#0000FF", "--inset", "0.05",
"--output", str(output_dir),
],
- capture_output=True, text=True, check=False,
+ capture_output=True, text=True, encoding="utf-8", errors="replace", check=False,
)
self.assertEqual(result.returncode, 1)
self.assertIn("painted backing panel", result.stderr)
diff --git a/skills/ppt-master/scripts/tests/test_text_measure.py b/skills/ppt-master/scripts/tests/test_text_measure.py
index 08f8e90c..e7e6b020 100644
--- a/skills/ppt-master/scripts/tests/test_text_measure.py
+++ b/skills/ppt-master/scripts/tests/test_text_measure.py
@@ -45,6 +45,8 @@ def _run_cli(*args: str) -> subprocess.CompletedProcess[str]:
[sys.executable, str(SCRIPT), *args],
capture_output=True,
text=True,
+ encoding="utf-8",
+ errors="replace",
check=False,
)
diff --git a/skills/ppt-master/scripts/tests/test_update_spec.py b/skills/ppt-master/scripts/tests/test_update_spec.py
index 38d73c07..237cc7b9 100644
--- a/skills/ppt-master/scripts/tests/test_update_spec.py
+++ b/skills/ppt-master/scripts/tests/test_update_spec.py
@@ -113,6 +113,8 @@ class UpdateSpecNativeFallbackTests(unittest.TestCase):
check=False,
capture_output=True,
text=True,
+ encoding="utf-8",
+ errors="replace",
)
self.assertEqual(dry_run.returncode, 0, dry_run.stderr)
self.assertIn(
@@ -132,6 +134,8 @@ class UpdateSpecNativeFallbackTests(unittest.TestCase):
check=False,
capture_output=True,
text=True,
+ encoding="utf-8",
+ errors="replace",
)
self.assertEqual(update.returncode, 0, update.stderr)
self.assertIn(
@@ -157,6 +161,8 @@ class UpdateSpecNativeFallbackTests(unittest.TestCase):
check=False,
capture_output=True,
text=True,
+ encoding="utf-8",
+ errors="replace",
)
self.assertEqual(
checker.returncode,