def METHOD_NAME(stream):
    """Force binary mode for stream on Windows."""
    if os.name == 'nt':
        f_fileno = getattr(stream, 'fileno', None)
        if f_fileno:
            fileno = f_fileno()
            if fileno >= 0:
                import msvcrt
                msvcrt.setmode(fileno, os.O_BINARY)
    return stream