check python encoding in SHELL_CONFIG validation

This commit is contained in:
Nick Sweeting 2024-09-25 01:14:48 -07:00
parent e0eb3119b7
commit 0ef3a0913b
No known key found for this signature in database
6 changed files with 29 additions and 29 deletions
archivebox

View file

@ -25,7 +25,6 @@ from .util import enforce_types
from .config import (
ConfigDict,
OUTPUT_DIR,
PYTHON_ENCODING,
VERSION,
ANSI,
IS_TTY,
@ -184,7 +183,7 @@ class TimedProgress:
@enforce_types
def progress_bar(seconds: int, prefix: str='') -> None:
"""show timer in the form of progress bar, with percentage and seconds remaining"""
chunk = '' if PYTHON_ENCODING == 'UTF-8' else '#'
chunk = '' if (sys.stdout or sys.__stdout__).encoding.upper() == 'UTF-8' else '#'
last_width = TERM_WIDTH()
chunks = last_width - len(prefix) - 20 # number of progress chunks to show (aka max bar width)
try: