Skip to content

Fix loading-screen crashes on redirected cp932 output - #8985

Open
saime428 wants to merge 2 commits into
isaac-sim:mainfrom
saime428:fix/loading-screen-encoding
Open

saime428 wants to merge 2 commits into
isaac-sim:mainfrom
saime428:fix/loading-screen-encoding

Conversation

@saime428

@saime428 saime428 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

When stdout uses strict cp932 encoding, the summary title Isaac Lab · train raises UnicodeEncodeError before training starts. This applies the fallback suggested in #8978: _write retries with replacement characters if the stream cannot encode the text. It keeps the characters the stream can display and leaves the stream settings and normal UTF-8 output unchanged.

The regression calls LoadingScreen.summary() with real cp932 and UTF-8 streams. It checks that the task information remains readable, encodable Japanese text survives, and the stream settings stay intact. The fix includes a package changelog entry.

Fixes #8978.

#8977 filters greeting art that the console cannot encode. The title still crashes on its head (2214b28f3332) with logo=False, so that fix does not cover this case.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing

Tested on macOS ARM64 with Python 3.12.15, rich 14.3.4, pytest 9.1.1, and lazy-loader 0.5. The uv environment contains the editable core package and test/format tools; commands use --no-sync to avoid installing the simulation stack.

The cp932 regression fails with UnicodeEncodeError on the original source at 4cfdfcfa52d7 and passes with the fix. The UTF-8 control passes on both.

  • uv run --no-sync python -m pytest source/isaaclab/test/app/test_loading_screen.py -q -k 'not test_interactive_input_shows_captured_context_before_waiting_for_answer': 15 passed, 1 deselected.
  • COLUMNS=30 uv run --no-sync python -m pytest source/isaaclab/test/app/test_loading_screen.py -k summary_preserves -q: 2 passed. Before pinning the test width, both cases failed because the task name wrapped.
  • uv run --no-sync python -m pytest source/isaaclab/test/app/test_remote_greetings.py -q: 4 passed.
  • ISAACLAB_CHANGELOG_BASE_REF=origin/main uv run --no-sync isaaclab --format: passed, including repository-wide lint, changelog, and Git LFS pointer checks.
  • git diff --check: passed.

The full test_loading_screen.py run has 15 passes and one failure: test_interactive_input_shows_captured_context_before_waiting_for_answer fails at assert b"Answer: NO" in output on this Mac. The same test fails after restoring the original production file. It is unchanged in this patch and excluded only from the focused command above.

A Japanese Windows training run and Docker/GPU tests were not run.

Checklist

  • Read the contribution guidelines.
  • Ran pre-commit with uv run --no-sync isaaclab --format.
  • Documented the fix in the package changelog.
  • No new warnings in the checks above.
  • Added focused regression coverage and checked it against the test-audit criteria.
  • Added a fragment under source/isaaclab/changelog.d/.
  • Already listed in CONTRIBUTORS.md as saime428.

Signed-off-by: saime428 <51110572+saime428@users.noreply.github.com>

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Needs attention: Style consistency (2). Other reviewed categories look good.

  • PR description: The title and body match the fallback, regression coverage, and changelog; reported baseline validation and the unchanged Mac test failure are explicit, with no performance claim requiring benchmarks.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: The fallback uses getattr for the known encoding attribute, hiding a missing attribute contrary to repository guidance; use self._console.encoding while retaining the None fallback.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 2 inline findings.

Automated review; human maintainers own approval decisions.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

Needs attention: Style consistency (2). Other reviewed categories look good.

  • PR description: The title and body match the fallback, changelog, and encoding regressions; validation limitations and the baseline Mac failure are disclosed, with no measurable performance claim requiring benchmarks.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: Reflective access to the known encoding attribute hides missing attributes behind ASCII; use self._console.encoding while retaining the None fallback.
  • Test quality: Test quality looks good.

Minor fixes needed. Posted 2 inline findings.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects console output during loading-screen startup.

The PR appears safe to merge, with a non-blocking improvement needed to make the new test independent of terminal width.

Findings

  1. P2 Narrow terminals fail the test ▶

Summary

The PR prevents redirected loading-screen output from crashing on characters its encoding cannot represent.

  • Loading-screen output survives characters a redirected console cannot encode.

Reviews (1) · Last reviewed commit: "Fix loading-screen crashes on redirected..." · Reviewed by Greptile

Signed-off-by: saime428 <51110572+saime428@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] Startup loading screen raises UnicodeEncodeError (cp932) when stdout is redirected on Japanese Windows

1 participant