# -*- coding: utf-8 -*- import io, sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') txt = open(r'e:\code\crm-backend-matt\logs\t04-run.log', encoding='utf-8', errors='replace').read() print('len=', len(txt)) print(txt[-3000:])