Related to #1966. Previously, we used a `syspath` call inside MediaFile, which
probably wasn't right: the constructor should behave like `open` in that we
need to use pass an OS path.
Part of #1966. This also introduces a nicer, more lightweight way to create and
destroy temporary directories, decoupling that functionality from the
giant morass that is TestHelper.
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
This is a little dirty, what with the hard-coded encoding, but I don't feel
too bad about it because we're only manipulating our test fixtures and
temporary directory that way.
More on #1966.
This is part of the effort to separate MediaFile from beets (#1966). It avoids
using the beets-specific logging infrastructure. This commit is part of
fdebab657d6e85de56b3996e8fdece09796940ae from the new MediaFile repository.
Sadly, I uploaded the wrong file to PyPI for 1.4.0. Once you do this, PyPI
never lets you change the file associated with a given released version. So we
need to use 1.4.1 instead. 😢
* Readability and consistency
* Better logging: warn by default for attributes that were not found,
but don't drown user with info when everything is going well.
* I don't see DefaultList be really helpful in many other cases, so having
a beets.util.collections module (which could also conflict with the collections
module from standard library) with only that in it is a little silly.
* It was elegant and concise, but there are implementation issues: it is not
recommended to subclass builtin types, but the alternatives differ between python
2 and 3 (subclass sequence or container or collections.abc?), moreover,
interpreters can differ in the way they map syntaxic sugar to magic functions.
* Also, slicing and negative indexing could do weird things, so the class wouldn't
be really intuitive and simple at the same time