Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for windows cp1252 encoding failure (fix test pipeline) #3687

Merged
merged 16 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
env:
DISPLAY: :0
PYTEST_ADDOPTS: "--color=yes" # colors in pytest
PYTHONIOENCODING: "utf8"
strategy:
fail-fast: false
matrix:
Expand Down
9 changes: 8 additions & 1 deletion manim/utils/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@


def capture(command, cwd=None, command_input=None):
p = run(command, cwd=cwd, input=command_input, capture_output=True, text=True)
p = run(
command,
cwd=cwd,
input=command_input,
capture_output=True,
text=True,
encoding="utf-8",
)
out, err = p.stdout, p.stderr
return out, err, p.returncode

Expand Down
6 changes: 4 additions & 2 deletions tests/test_logging/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ def test_error_logging(tmp_path, python_version):
str(path_error_scene),
]

_, err, exitcode = capture(command)
assert exitcode != 0 and len(err) > 0
out, err, exitcode = capture(command)
if err is None:
err = out
assert exitcode != 0 and "Traceback (most recent call last)" in err


@logs_comparison(
Expand Down
Loading