mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 05:08:19 +08:00
Fix: Encoding error
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import codecs
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
@@ -15,6 +16,14 @@ from rich.style import Style
|
|||||||
from rich.theme import Theme
|
from rich.theme import Theme
|
||||||
from rich.traceback import Traceback
|
from rich.traceback import Traceback
|
||||||
|
|
||||||
|
try:
|
||||||
|
if sys.stdout.encoding.lower() != 'utf-8':
|
||||||
|
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.buffer, 'strict')
|
||||||
|
if sys.stderr.encoding.lower() != 'utf-8':
|
||||||
|
sys.stderr = codecs.getwriter('utf-8')(sys.stderr.buffer, 'strict')
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def empty_function(*args, **kwargs):
|
def empty_function(*args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user