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 just_fix_windows_console to use the StreamWrapper #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 9, 2024

  1. Fix just_fix_windows_console to use the StreamWrapper

    The AnsiToWin32 class is not meant to be used as a file proxy directly, although it does define the write method, but it defines a `stream` member of type StreamWrapper which forwards/intercepts all the file operations as appropriate. In `init` which calls `wrap_stream` this underlying stream object is assigned to sys.stdout/stderr, but the `just_fix_windows_console` function instead assigns the AnsiToWin32 instance directly, which will break trying to use any other methods than `write` on the standard streams.
    
    This change fixes the behavior of `just_fix_windows_console` to use the StreamWrapper object as in `init`.
    rmccampbell authored Nov 9, 2024
    Configuration menu
    Copy the full SHA
    8af7be1 View commit details
    Browse the repository at this point in the history