mirror of
https://github.com/fergalmoran/picard.git
synced 2026-04-01 10:05:15 +00:00
PICARD-1867: Handle errors in guess_format
This commit is contained in:
@@ -183,7 +183,12 @@ class File(QtCore.QObject, Item):
|
||||
|
||||
# If loading failed, force format guessing and try loading again
|
||||
from picard.formats.util import guess_format
|
||||
alternative_file = guess_format(self.base_filename)
|
||||
try:
|
||||
alternative_file = guess_format(self.filename)
|
||||
except (FileNotFoundError, OSError):
|
||||
log.error("Guessing format of %s failed", self.filename, exc_info=True)
|
||||
alternative_file = None
|
||||
|
||||
if alternative_file:
|
||||
# Do not retry reloading exactly the same file format
|
||||
if type(alternative_file) != type(self): # pylint: disable=unidiomatic-typecheck
|
||||
|
||||
Reference in New Issue
Block a user