diff --git a/beets/library.py b/beets/library.py index 9b1055793..08cac4323 100644 --- a/beets/library.py +++ b/beets/library.py @@ -472,10 +472,13 @@ class Item(LibModel): for key in ITEM_KEYS_META: value = getattr(f, key) - if isinstance(value, (int, long)) and value.bit_length() > 63: + if isinstance(value, (int, long)): # Filter values wider than 64 bits (in signed # representation). SQLite cannot store them. - value = 0 + # py26: Post transition, we can use: + # value.bit_length() > 63 + if abs(value) >= 2 ** 63: + value = 0 setattr(self, key, value) # Database's mtime should now reflect the on-disk value.