DrTrigon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/112313

Change subject: bugfix; Exception: cannot find nearest multiple for a value 
less than the unit: -0.0104166666667, 0.125
......................................................................

bugfix; Exception: cannot find nearest multiple for a value less than the unit: 
-0.0104166666667, 0.125

Change-Id: Iaf8a9cbe6704e3727a7d3db4020e018b3ff94b43
---
M catimages.py
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/13/112313/1

diff --git a/catimages.py b/catimages.py
index e00bda0..a488011 100644
--- a/catimages.py
+++ b/catimages.py
@@ -3024,6 +3024,8 @@
                 result.update(s.metadata)
         except music21.midi.base.MidiException:
             pass
+        except Exception:
+            pass
 
         self._properties['Metadata'] = [result]
         return
@@ -3038,7 +3040,7 @@
         d = self._util_get_DataStreams_MUSIC21()
 
         result =      { 'Format':     u'%s' % self.file_mime[1].upper(),
-                        'Length':     d["duration"],    # secs
+                        'Length':     d["duration"] if d else u'-',    # secs
                         'Dimensions': self.image_size,
                         'Filesize':   os.path.getsize(self.file_name),
                         'MIME':       u'%s/%s' % tuple(self.file_mime[:2]), }
@@ -3094,6 +3096,9 @@
         except music21.midi.base.MidiException:
             pywikibot.warning(u'unknown file type [_detect_Streams]')
             return
+        except Exception:
+            pywikibot.warning(u'unknown file type [_detect_Streams]')
+            return
 
         #fs = music21.features.jSymbolic.extractorsById
         #for k in fs:

-- 
To view, visit https://gerrit.wikimedia.org/r/112313
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf8a9cbe6704e3727a7d3db4020e018b3ff94b43
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: DrTrigon <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to