Skip to content

Commit

Permalink
fix: Please the Windows overlords
Browse files Browse the repository at this point in the history
On Windows, `print` (which uses `sys.stdout` per default) defaults to `cp1252`
when piping, breaking e.g. rip-grep and all other Unicode-based tools.
  • Loading branch information
alexpovel committed Sep 18, 2022
1 parent 99ce154 commit fb58c58
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ancv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import sys
from enum import IntEnum
from pathlib import Path

PROJECT_ROOT = Path(__file__).parent
PACKAGE = __package__

# See also https://github.com/python/typeshed/issues/3049
sys.stdout.reconfigure(encoding="utf-8") # type: ignore[attr-defined]


class SIPrefix(IntEnum):
KILO = 1e3
Expand Down

0 comments on commit fb58c58

Please sign in to comment.