Skip to content

Commit

Permalink
为releaseLogFile函数读取文件时添加errors='ignore',以排除可能意外出现的log文件内容错误
Browse files Browse the repository at this point in the history
  • Loading branch information
komeijichen committed Jul 26, 2024
1 parent 4b3dbd7 commit 70566db
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 @@ -177,7 +177,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 70566db

Please sign in to comment.