diff --git a/picard/file.py b/picard/file.py index 101a3b0035..857ee99f7a 100644 --- a/picard/file.py +++ b/picard/file.py @@ -826,7 +826,10 @@ def column(self, column): if not value and not get_config().setting['clear_existing_tags']: value = self.orig_metadata[column] if column == '~filesize': - value = bytes2human.binary(value) + try: + value = bytes2human.binary(value) + except ValueError: + pass return value def _lookup_finished(self, lookuptype, document, http, error): diff --git a/picard/ui/infodialog.py b/picard/ui/infodialog.py index c58c7487be..6d34cf1cc1 100644 --- a/picard/ui/infodialog.py +++ b/picard/ui/infodialog.py @@ -287,7 +287,10 @@ def format_file_info(file_): info.append((_("Format:"), file_.orig_metadata['~format'])) if '~filesize' in file_.orig_metadata: size = file_.orig_metadata['~filesize'] - sizestr = "%s (%s)" % (bytes2human.decimal(size), bytes2human.binary(size)) + try: + sizestr = "%s (%s)" % (bytes2human.decimal(size), bytes2human.binary(size)) + except ValueError: + sizestr = _("unknown") info.append((_("Size:"), sizestr)) if file_.orig_metadata.length: info.append((_("Length:"), format_time(file_.orig_metadata.length)))