import sys # Ensure console output uses UTF-8 on Windows to prevent UnicodeEncodeErrors during piped test runs if sys.platform.startswith('win'): try: if hasattr(sys.stdout, 'reconfigure'): sys.stdout.reconfigure(encoding='utf-8') if hasattr(sys.stderr, 'reconfigure'): sys.stderr.reconfigure(encoding='utf-8') except Exception: pass