mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-19 18:37:39 +03:00
Merge pull request #1001 from A-UNDERSCORE-D/fix/unicode-error-error
Fixed edge case with reading old ship loadout
This commit is contained in:
commit
c2dec59e78
@ -1265,6 +1265,13 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
||||
except OSError:
|
||||
logger.exception("OSError reading old ship loadout default encoding.")
|
||||
|
||||
except ValueError:
|
||||
# User was on $OtherEncoding, updated windows to be sane and use utf8 everywhere, thus
|
||||
# the above open() fails, likely with a UnicodeDecodeError, which subclasses UnicodeError which
|
||||
# subclasses ValueError, this catches ValueError _instead_ of UnicodeDecodeError just to be sure
|
||||
# that if some other encoding error crops up we grab it too.
|
||||
logger.exception('ValueError when reading old ship loadout default encoding')
|
||||
|
||||
except OSError:
|
||||
logger.exception("OSError reading old ship loadout with default encoding")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user