Skip to content

Commit

Permalink
Merge pull request #2 from komeijichen/releaseLogErrIgnore
Browse files Browse the repository at this point in the history
为releaseLogFile函数读取文件时添加errors='ignore',以排除可能意外出现的log文件内容错误
  • Loading branch information
MetaLe0 authored Jul 27, 2024
2 parents 09f42a0 + 70566db commit 47e92c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OlivaDiceLogger/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def releaseLogFile(logName):
dataLogFile = '%s%s/%s.olivadicelog' % (dataPath, dataLogPath, logName)
dataLogFile_1 = '%s%s/%s.trpglog' % (dataPath, dataLogPath, logName)
tmp_dataLogFile = None
with open(dataLogFile, 'r+', encoding = 'utf-8') as dataLogFile_f:
with open(dataLogFile, 'r+', encoding = 'utf-8' , errors='ignore' ) as dataLogFile_f:
tmp_dataLogFile = dataLogFile_f.read()
if tmp_dataLogFile != None:
tmp_dataLogFile = tmp_dataLogFile.strip('\n')
Expand Down

0 comments on commit 47e92c9

Please sign in to comment.