Skip to content

Commit 93cf85c

Browse files
Attempted fix for windows cp1252 encoding failure (#3687)
* Attempt to fix windows test * Revert "Attempt to fix windows test" This reverts commit e31c207. * try a different fix * maybe both fixes together? * try adding in CI * Update ci.yml * Update logger_utils.py * maybe needs a dash? * try utf8 again * Remove legacy_windows * try changing test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Try decoding after capturing bytes output * Nicer fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci
1 parent 294313d commit 93cf85c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
env:
1919
DISPLAY: :0
2020
PYTEST_ADDOPTS: "--color=yes" # colors in pytest
21+
PYTHONIOENCODING: "utf8"
2122
strategy:
2223
fail-fast: false
2324
matrix:

manim/utils/commands.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@
1414

1515

1616
def capture(command, cwd=None, command_input=None):
17-
p = run(command, cwd=cwd, input=command_input, capture_output=True, text=True)
17+
p = run(
18+
command,
19+
cwd=cwd,
20+
input=command_input,
21+
capture_output=True,
22+
text=True,
23+
encoding="utf-8",
24+
)
1825
out, err = p.stdout, p.stderr
1926
return out, err, p.returncode
2027

tests/test_logging/test_logging.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ def test_error_logging(tmp_path, python_version):
4343
str(path_error_scene),
4444
]
4545

46-
_, err, exitcode = capture(command)
47-
assert exitcode != 0 and len(err) > 0
46+
out, err, exitcode = capture(command)
47+
if err is None:
48+
err = out
49+
assert exitcode != 0 and "Traceback (most recent call last)" in err
4850

4951

5052
@logs_comparison(

0 commit comments

Comments
 (0)