diff -Nru mutagen-1.45.0/debian/changelog mutagen-1.45.1/debian/changelog --- mutagen-1.45.0/debian/changelog 2020-07-22 16:42:13.000000000 +0000 +++ mutagen-1.45.1/debian/changelog 2020-10-20 07:43:23.000000000 +0000 @@ -1,3 +1,27 @@ +mutagen (1.45.1-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/control: Update Vcs-* fields with new Debian Python Team Salsa + layout. + + [ Michael Hudson-Doyle ] + * d/tests/control: Add python3-all to Depends: (Closes: #972526) + + -- Tristan Seligmann Tue, 20 Oct 2020 09:43:23 +0200 + +mutagen (1.45.1-1) unstable; urgency=medium + + * New upstream release. + + -- Tristan Seligmann Thu, 20 Aug 2020 18:04:10 +0200 + +mutagen (1.45.0-2) unstable; urgency=medium + + * Add Breaks: beets (old autopkgtests fail with new mutagen). + * Fix privacy violations. + + -- Tristan Seligmann Wed, 12 Aug 2020 16:12:40 +0200 + mutagen (1.45.0-1) unstable; urgency=low [ Debian Janitor ] diff -Nru mutagen-1.45.0/debian/control mutagen-1.45.1/debian/control --- mutagen-1.45.0/debian/control 2020-07-22 16:42:13.000000000 +0000 +++ mutagen-1.45.1/debian/control 2020-10-20 07:43:23.000000000 +0000 @@ -24,8 +24,8 @@ python3-sphinx-rtd-theme , vorbis-tools , Standards-Version: 4.5.0 -Vcs-Git: https://salsa.debian.org/python-team/modules/mutagen.git -Vcs-Browser: https://salsa.debian.org/python-team/modules/mutagen +Vcs-Git: https://salsa.debian.org/python-team/packages/mutagen.git +Vcs-Browser: https://salsa.debian.org/python-team/packages/mutagen Homepage: https://github.com/quodlibet/mutagen Rules-Requires-Root: no @@ -33,7 +33,7 @@ Architecture: all Depends: ${misc:Depends}, ${python3:Depends} Suggests: python-mutagen-doc -Breaks: python-mutagen (<< 1.44.0-1) +Breaks: beets (<< 1.4.9-6~), python-mutagen (<< 1.44.0-1) Replaces: python-mutagen (<< 1.44.0-1) Description: audio metadata editing library (Python 3) Mutagen is a Python module to handle audio metadata. It supports FLAC, diff -Nru mutagen-1.45.0/debian/patches/0003-Drop-external-images-from-README.rst.patch mutagen-1.45.1/debian/patches/0003-Drop-external-images-from-README.rst.patch --- mutagen-1.45.0/debian/patches/0003-Drop-external-images-from-README.rst.patch 1970-01-01 00:00:00.000000000 +0000 +++ mutagen-1.45.1/debian/patches/0003-Drop-external-images-from-README.rst.patch 2020-10-20 07:43:23.000000000 +0000 @@ -0,0 +1,27 @@ +From: Tristan Seligmann +Date: Wed, 12 Aug 2020 16:01:17 +0200 +Subject: Drop external images from README.rst + +--- + README.rst | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/README.rst b/README.rst +index 7084902..1cd6c6e 100644 +--- a/README.rst ++++ b/README.rst +@@ -1,7 +1,3 @@ +-.. image:: https://raw.githubusercontent.com/quodlibet/mutagen/master/docs/images/logo.svg +- :align: center +- :width: 400px +- + | + + Mutagen is a Python module to handle audio metadata. It supports ASF, FLAC, +@@ -17,6 +13,3 @@ macOS, and has no dependencies outside the Python standard library. Mutagen + is licensed under the GPL version 2 or later. + + For more information visit https://mutagen.readthedocs.org +- +-.. image:: https://codecov.io/gh/quodlibet/mutagen/branch/master/graph/badge.svg +- :target: https://codecov.io/gh/quodlibet/mutagen diff -Nru mutagen-1.45.0/debian/patches/series mutagen-1.45.1/debian/patches/series --- mutagen-1.45.0/debian/patches/series 2020-07-22 16:42:13.000000000 +0000 +++ mutagen-1.45.1/debian/patches/series 2020-10-20 07:43:23.000000000 +0000 @@ -1,2 +1,3 @@ use-rtd-package use-system-inventory +0003-Drop-external-images-from-README.rst.patch diff -Nru mutagen-1.45.0/debian/patches/use-rtd-package mutagen-1.45.1/debian/patches/use-rtd-package --- mutagen-1.45.0/debian/patches/use-rtd-package 2020-07-22 16:42:13.000000000 +0000 +++ mutagen-1.45.1/debian/patches/use-rtd-package 2020-10-20 07:43:23.000000000 +0000 @@ -1,4 +1,3 @@ -From fbcbfb3c82d758c6ac907ef121874ec7cc4275d4 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Thu, 8 Oct 2015 09:57:12 -0700 Subject: Use the Debian package of the sphinx-rtd theme @@ -11,7 +10,7 @@ 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py -index 5407704..7cb534a 100644 +index 31a82e6..be33500 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,6 +2,7 @@ diff -Nru mutagen-1.45.0/debian/patches/use-system-inventory mutagen-1.45.1/debian/patches/use-system-inventory --- mutagen-1.45.0/debian/patches/use-system-inventory 2020-07-22 16:42:13.000000000 +0000 +++ mutagen-1.45.1/debian/patches/use-system-inventory 2020-10-20 07:43:23.000000000 +0000 @@ -1,4 +1,3 @@ -From bba99d03bae536725f52b71fbcefaf35b0599fe8 Mon Sep 17 00:00:00 2001 From: Tristan Seligmann Date: Thu, 8 Oct 2015 09:57:13 -0700 Subject: Use the system copy of the Python documentation inventory @@ -6,9 +5,11 @@ Forwarded: no Patch-Name: use-system-inventory --- - docs/conf.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + docs/conf.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/docs/conf.py b/docs/conf.py +index be33500..a092a66 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ extensions = [ diff -Nru mutagen-1.45.0/debian/tests/control mutagen-1.45.1/debian/tests/control --- mutagen-1.45.0/debian/tests/control 2020-07-22 16:42:13.000000000 +0000 +++ mutagen-1.45.1/debian/tests/control 2020-10-20 07:43:23.000000000 +0000 @@ -1,2 +1,2 @@ Test-Command: set -e ; for py in $(py3versions -r 2>/dev/null) ; do echo "Testing with $py:" ; $py -m pytest -m "not quality" ; done -Depends: python3-mutagen, python3-pytest, python3-hypothesis +Depends: python3-hypothesis, python3-mutagen, python3-pytest, python3-all diff -Nru mutagen-1.45.0/docs/user/examples/fileobj-iface.py mutagen-1.45.1/docs/user/examples/fileobj-iface.py --- mutagen-1.45.0/docs/user/examples/fileobj-iface.py 2019-10-14 07:38:56.000000000 +0000 +++ mutagen-1.45.1/docs/user/examples/fileobj-iface.py 2020-07-18 06:55:59.000000000 +0000 @@ -101,7 +101,7 @@ """Returns the file descriptor (int) or raises IOError if there is none. - Will be used for mmap if available. + Will be used for low level operations if available. """ raise NotImplementedError diff -Nru mutagen-1.45.0/mutagen/__init__.py mutagen-1.45.1/mutagen/__init__.py --- mutagen-1.45.0/mutagen/__init__.py 2020-07-11 16:04:45.000000000 +0000 +++ mutagen-1.45.1/mutagen/__init__.py 2020-07-11 16:07:55.000000000 +0000 @@ -23,7 +23,7 @@ from mutagen._file import FileType, StreamInfo, File from mutagen._tags import Tags, Metadata, PaddingInfo -version = (1, 45, 0) +version = (1, 45, 1) """Version tuple.""" version_string = ".".join(map(str, version)) diff -Nru mutagen-1.45.0/mutagen/_util.py mutagen-1.45.1/mutagen/_util.py --- mutagen-1.45.0/mutagen/_util.py 2020-07-11 15:17:20.000000000 +0000 +++ mutagen-1.45.1/mutagen/_util.py 2020-07-18 08:15:51.000000000 +0000 @@ -19,19 +19,15 @@ import decimal from io import BytesIO -try: - import mmap -except ImportError: - # Google App Engine has no mmap: - # https://github.com/quodlibet/mutagen/issues/286 - mmap = None # type: ignore - from collections import namedtuple from contextlib import contextmanager from functools import wraps from fnmatch import fnmatchcase +_DEFAULT_BUFFER_SIZE = 2 ** 18 + + def endswith(text, end): # usefull for paths which can be both, str and bytes if isinstance(text, str): @@ -687,65 +683,7 @@ fileobj.seek(-offset, 2) -def mmap_move(fileobj, dest, src, count): - """Mmaps the file object if possible and moves 'count' data - from 'src' to 'dest'. All data has to be inside the file size - (enlarging the file through this function isn't possible) - - Will adjust the file offset. - - Args: - fileobj (fileobj) - dest (int): The destination offset - src (int): The source offset - count (int) The amount of data to move - Raises: - mmap.error: In case move failed - IOError: In case an operation on the fileobj fails - ValueError: In case invalid parameters were given - """ - - assert mmap is not None, "no mmap support" - - if dest < 0 or src < 0 or count < 0: - raise ValueError("Invalid parameters") - - try: - fileno = fileobj.fileno() - except (AttributeError, IOError): - raise mmap.error( - "File object does not expose/support a file descriptor") - - fileobj.seek(0, 2) - filesize = fileobj.tell() - length = max(dest, src) + count - - if length > filesize: - raise ValueError("Not in file size boundary") - - offset = ((min(dest, src) // mmap.ALLOCATIONGRANULARITY) * - mmap.ALLOCATIONGRANULARITY) - assert dest >= offset - assert src >= offset - assert offset % mmap.ALLOCATIONGRANULARITY == 0 - - # Windows doesn't handle empty mappings, add a fast path here instead - if count == 0: - return - - # fast path - if src == dest: - return - - fileobj.flush() - file_map = mmap.mmap(fileno, length - offset, offset=offset) - try: - file_map.move(dest - offset, src - offset, count) - finally: - file_map.close() - - -def resize_file(fobj, diff, BUFFER_SIZE=2 ** 16): +def resize_file(fobj, diff, BUFFER_SIZE=_DEFAULT_BUFFER_SIZE): """Resize a file by `diff`. New space will be filled with zeros. @@ -782,7 +720,7 @@ raise -def fallback_move(fobj, dest, src, count, BUFFER_SIZE=2 ** 16): +def move_bytes(fobj, dest, src, count, BUFFER_SIZE=_DEFAULT_BUFFER_SIZE): """Moves data around using read()/write(). Args: @@ -825,12 +763,11 @@ fobj.flush() -def insert_bytes(fobj, size, offset, BUFFER_SIZE=2 ** 16): +def insert_bytes(fobj, size, offset, BUFFER_SIZE=_DEFAULT_BUFFER_SIZE): """Insert size bytes of empty space starting at offset. fobj must be an open file object, open rb+ or - equivalent. Mutagen tries to use mmap to resize the file, but - falls back to a significantly slower method if mmap fails. + equivalent. Args: fobj (fileobj) @@ -851,22 +788,14 @@ raise ValueError resize_file(fobj, size, BUFFER_SIZE) - - if mmap is not None: - try: - mmap_move(fobj, offset + size, offset, movesize) - except mmap.error: - fallback_move(fobj, offset + size, offset, movesize, BUFFER_SIZE) - else: - fallback_move(fobj, offset + size, offset, movesize, BUFFER_SIZE) + move_bytes(fobj, offset + size, offset, movesize, BUFFER_SIZE) -def delete_bytes(fobj, size, offset, BUFFER_SIZE=2 ** 16): +def delete_bytes(fobj, size, offset, BUFFER_SIZE=_DEFAULT_BUFFER_SIZE): """Delete size bytes of empty space starting at offset. fobj must be an open file object, open rb+ or - equivalent. Mutagen tries to use mmap to resize the file, but - falls back to a significantly slower method if mmap fails. + equivalent. Args: fobj (fileobj) @@ -886,14 +815,7 @@ if movesize < 0: raise ValueError - if mmap is not None: - try: - mmap_move(fobj, offset, offset + size, movesize) - except mmap.error: - fallback_move(fobj, offset, offset + size, movesize, BUFFER_SIZE) - else: - fallback_move(fobj, offset, offset + size, movesize, BUFFER_SIZE) - + move_bytes(fobj, offset, offset + size, movesize, BUFFER_SIZE) resize_file(fobj, -size, BUFFER_SIZE) diff -Nru mutagen-1.45.0/mutagen.egg-info/PKG-INFO mutagen-1.45.1/mutagen.egg-info/PKG-INFO --- mutagen-1.45.0/mutagen.egg-info/PKG-INFO 2020-07-11 16:05:02.000000000 +0000 +++ mutagen-1.45.1/mutagen.egg-info/PKG-INFO 2020-07-31 08:38:44.000000000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: mutagen -Version: 1.45.0 +Version: 1.45.1 Summary: read and write audio tags for many formats Home-page: https://github.com/quodlibet/mutagen Author: Christoph Reiter @@ -26,12 +26,6 @@ For more information visit https://mutagen.readthedocs.org - .. image:: https://travis-ci.org/quodlibet/mutagen.svg?branch=master - :target: https://travis-ci.org/quodlibet/mutagen - - .. image:: https://dev.azure.com/quodlibet/mutagen/_apis/build/status/quodlibet.mutagen - :target: https://dev.azure.com/quodlibet/mutagen/_build/latest?definitionId=3 - .. image:: https://codecov.io/gh/quodlibet/mutagen/branch/master/graph/badge.svg :target: https://codecov.io/gh/quodlibet/mutagen diff -Nru mutagen-1.45.0/NEWS mutagen-1.45.1/NEWS --- mutagen-1.45.0/NEWS 2020-07-11 16:04:45.000000000 +0000 +++ mutagen-1.45.1/NEWS 2020-07-31 08:36:10.000000000 +0000 @@ -1,3 +1,12 @@ +.. _release-1.45.1: + +1.45.1 - 2020-07-31 +------------------- + +* Fix flake8 tests when run after calling ``setup.py build`` :bug:`482` +* No longer use mmap when rewriting files. Fixes slow save performance with Windows network shares, ZFS and more :pr:`483` :pr:`484` + + .. _release-1.45.0: 1.45.0 - 2020-07-11 diff -Nru mutagen-1.45.0/PKG-INFO mutagen-1.45.1/PKG-INFO --- mutagen-1.45.0/PKG-INFO 2020-07-11 16:05:02.995293600 +0000 +++ mutagen-1.45.1/PKG-INFO 2020-07-31 08:38:44.827105000 +0000 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: mutagen -Version: 1.45.0 +Version: 1.45.1 Summary: read and write audio tags for many formats Home-page: https://github.com/quodlibet/mutagen Author: Christoph Reiter @@ -26,12 +26,6 @@ For more information visit https://mutagen.readthedocs.org - .. image:: https://travis-ci.org/quodlibet/mutagen.svg?branch=master - :target: https://travis-ci.org/quodlibet/mutagen - - .. image:: https://dev.azure.com/quodlibet/mutagen/_apis/build/status/quodlibet.mutagen - :target: https://dev.azure.com/quodlibet/mutagen/_build/latest?definitionId=3 - .. image:: https://codecov.io/gh/quodlibet/mutagen/branch/master/graph/badge.svg :target: https://codecov.io/gh/quodlibet/mutagen diff -Nru mutagen-1.45.0/README.rst mutagen-1.45.1/README.rst --- mutagen-1.45.0/README.rst 2020-07-11 15:21:50.000000000 +0000 +++ mutagen-1.45.1/README.rst 2020-07-12 11:36:56.000000000 +0000 @@ -18,11 +18,5 @@ For more information visit https://mutagen.readthedocs.org -.. image:: https://travis-ci.org/quodlibet/mutagen.svg?branch=master - :target: https://travis-ci.org/quodlibet/mutagen - -.. image:: https://dev.azure.com/quodlibet/mutagen/_apis/build/status/quodlibet.mutagen - :target: https://dev.azure.com/quodlibet/mutagen/_build/latest?definitionId=3 - .. image:: https://codecov.io/gh/quodlibet/mutagen/branch/master/graph/badge.svg :target: https://codecov.io/gh/quodlibet/mutagen diff -Nru mutagen-1.45.0/setup.cfg mutagen-1.45.1/setup.cfg --- mutagen-1.45.0/setup.cfg 2020-07-11 16:05:02.995293600 +0000 +++ mutagen-1.45.1/setup.cfg 2020-07-31 08:38:44.831105000 +0000 @@ -7,7 +7,8 @@ [flake8] ignore = E128,W601,E402,E731,W503,E741,E305,E121,E124,W504 -exclude = mutagen/_senf +exclude = mutagen/_senf,build,dist +max-line-length = 88 [tool:pytest] markers = diff -Nru mutagen-1.45.0/setup.py mutagen-1.45.1/setup.py --- mutagen-1.45.0/setup.py 2020-07-11 15:17:20.000000000 +0000 +++ mutagen-1.45.1/setup.py 2020-07-31 08:38:42.000000000 +0000 @@ -95,8 +95,8 @@ assert process.returncode == 0 tracked_files = out.splitlines() - for ignore in [".travis.yml", ".gitignore", ".codecov.yml", - "azure-pipelines.yml"]: + for ignore in [".gitignore", ".codecov.yml", + ".github/workflows/test.yml"]: tracked_files.remove(ignore) tracked_files = [ diff -Nru mutagen-1.45.0/tests/test__util.py mutagen-1.45.1/tests/test__util.py --- mutagen-1.45.0/tests/test__util.py 2020-07-11 15:17:20.000000000 +0000 +++ mutagen-1.45.1/tests/test__util.py 2020-07-18 06:55:59.000000000 +0000 @@ -2,14 +2,13 @@ from mutagen._util import DictMixin, cdata, insert_bytes, delete_bytes, \ decode_terminated, dict_match, enum, get_size, BitReader, BitReaderError, \ - resize_bytes, seek_end, mmap_move, verify_fileobj, fileobj_name, \ - read_full, flags, resize_file, fallback_move, encode_endian, loadfile, \ + resize_bytes, seek_end, verify_fileobj, fileobj_name, \ + read_full, flags, resize_file, move_bytes, encode_endian, loadfile, \ intround, verify_filename from tests import TestCase, get_temp_empty import os import random import tempfile -import mmap import errno import builtins from io import BytesIO @@ -332,9 +331,9 @@ self.assertEqual(h.tell(), 3) -class TMoveMixin(object): +class TMoveMixin(TestCase): - MOVE = None + MOVE = staticmethod(move_bytes) def file(self, contents): temp = tempfile.TemporaryFile() @@ -373,32 +372,6 @@ self.MOVE(o, 0, 1, 2) self.MOVE(o, 1, 0, 2) - def test_larger_than_page_size(self): - off = mmap.ALLOCATIONGRANULARITY - with self.file(b"f" * off * 2) as o: - self.MOVE(o, off, off + 1, off - 1) - self.MOVE(o, off + 1, off, off - 1) - - with self.file(b"f" * off * 2 + b"x") as o: - self.MOVE(o, off * 2 - 1, off * 2, 1) - self.assertEqual(self.read(o)[-3:], b"fxx") - - -class Tfallback_move(TestCase, TMoveMixin): - - MOVE = staticmethod(fallback_move) - - -class MmapMove(TestCase, TMoveMixin): - - MOVE = staticmethod(mmap_move) - - def test_stringio(self): - self.assertRaises(mmap.error, mmap_move, BytesIO(), 0, 0, 0) - - def test_no_fileno(self): - self.assertRaises(mmap.error, mmap_move, object(), 0, 0, 0) - class FileHandling(TestCase): def file(self, contents): @@ -519,8 +492,7 @@ def test_insert_6106_79_51760(self): # This appears to be due to ANSI C limitations in read/write on rb+ - # files. The problematic behavior only showed up in our mmap fallback - # code for transfers of this or similar sizes. + # files. data = u''.join(map(str, range(12574))) # 51760 bytes data = data.encode("ascii") with self.file(data) as o: @@ -529,8 +501,7 @@ def test_delete_6106_79_51760(self): # This appears to be due to ANSI C limitations in read/write on rb+ - # files. The problematic behavior only showed up in our mmap fallback - # code for transfers of this or similar sizes. + # files. data = u''.join(map(str, range(12574))) # 51760 bytes data = data.encode("ascii") with self.file(data[:6106 + 79] + data[79:]) as o: @@ -585,41 +556,6 @@ self.failUnless(fobj.read() == data) -class FileHandlingMockedMMap(FileHandling): - - def setUp(self): - def MockMMap2(*args, **kwargs): - raise mmap.error - - self._orig_mmap = mmap.mmap - mmap.mmap = MockMMap2 - - def tearDown(self): - mmap.mmap = self._orig_mmap - - -class FileHandlingNoMMap(FileHandling): - """Disables mmap and makes sure it raises if it still gets used somehow""" - - def setUp(self): - from mutagen import _util - - def MockMMap2(*args, **kwargs): - assert False - - self._orig_mmap = mmap.mmap - mmap.mmap = MockMMap2 - - _util.mmap = None - - def tearDown(self): - from mutagen import _util - import mmap - - _util.mmap = mmap - mmap.mmap = self._orig_mmap - - class Tdict_match(TestCase): def test_match(self):