We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
python-mpd is old and crusty, beets should start using python-mpd2
Assuming that at some point in time `beets` needs to run on Python 3 (which it does eventually, because Python 2 is being phased out), there will be an issue concerning `python-mpd`; `python-mpd` is not compatible with Python 3, nor is it really even maintained upstream anymore. The [last update was in December of 2010](https://pypi.python.org/pypi/python-mpd/), and it's website is down as well.

[`python-mpd2`](https://github.com/Mic92/python-mpd2), however, is maintained and sees fairly active development. It is a fork of `python-mpd`, and has [a document explaining porting](https://github.com/Mic92/python-mpd2/blob/1c7e8f246465110ccb2d64df829c6dbdcdc74c9e/doc/topics/porting.rst) from `python-mpd` on the repository. Aside from the stickers API, which I'm not even sure `beets` uses, it looks fairly easy to replace.

I think that it would be better to use python-mpd2 for these reasons. Any thoughts?


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 # This file is part of beets.
4 # Copyright 2015, Adrian Sampson.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining
7 # a copy of this software and associated documentation files (the
8 # "Software"), to deal in the Software without restriction, including
9 # without limitation the rights to use, copy, modify, merge, publish,
10 # distribute, sublicense, and/or sell copies of the Software, and to
11 # permit persons to whom the Software is furnished to do so, subject to
12 # the following conditions:
13 #
14 # The above copyright notice and this permission notice shall be
15 # included in all copies or substantial portions of the Software.
16 
17 from __future__ import division, absolute_import, print_function
18 
19 import os
20 import sys
21 import subprocess
22 import shutil
23 from setuptools import setup
24 
25 
26 def _read(fn):
27     path = os.path.join(os.path.dirname(__file__), fn)
28     return open(path).read()
29 
30 
31 def build_manpages():
32     # Go into the docs directory and build the manpage.
33     docdir = os.path.join(os.path.dirname(__file__), 'docs')
34     curdir = os.getcwd()
35     os.chdir(docdir)
36     try:
37         subprocess.check_call(['make', 'man'])
38     except OSError:
39         print("Could not build manpages (make man failed)!", file=sys.stderr)
40         return
41     finally:
42         os.chdir(curdir)
43 
44     # Copy resulting manpages.
45     mandir = os.path.join(os.path.dirname(__file__), 'man')
46     if os.path.exists(mandir):
47         shutil.rmtree(mandir)
48     shutil.copytree(os.path.join(docdir, '_build', 'man'), mandir)
49 
50 
51 # Build manpages if we're making a source distribution tarball.
52 if 'sdist' in sys.argv:
53     build_manpages()
54 
55 
56 setup(
57     name='beets',
58     version='1.3.14',
59     description='music tagger and library organizer',
60     author='Adrian Sampson',
61     author_email='adrian@radbox.org',
62     url='http://beets.radbox.org/',
63     license='MIT',
64     platforms='ALL',
65     long_description=_read('README.rst'),
66     test_suite='test.testall.suite',
67     include_package_data=True,  # Install plugin resources.
68 
69     packages=[
70         'beets',
71         'beets.ui',
72         'beets.autotag',
73         'beets.util',
74         'beets.dbcore',
75         'beetsplug',
76         'beetsplug.bpd',
77         'beetsplug.web',
78         'beetsplug.lastgenre',
79         'beetsplug.metasync',
80     ],
81     entry_points={
82         'console_scripts': [
83             'beet = beets.ui:main',
84         ],
85     },
86 
87     install_requires=[
88         'enum34>=1.0.4',
89         'mutagen>=1.27',
90         'munkres',
91         'unidecode',
92         'musicbrainzngs>=0.4',
93         'pyyaml',
94         'jellyfish',
95     ] + (['colorama'] if (sys.platform == 'win32') else []) +
96         (['ordereddict'] if sys.version_info < (2, 7, 0) else []),
97 
98     tests_require=[
99         'beautifulsoup4',
100         'flask',
101         'mock',
102         'pyechonest',
103         'pylast',
104         'rarfile',
105         'responses',
106         'pyxdg',
107         'pathlib',
108         'python-mpd',
109     ],
110 
111     # Plugin (optional) dependencies:
112     extras_require={
113         'fetchart': ['requests'],
114         'chroma': ['pyacoustid'],
115         'discogs': ['discogs-client>=2.1.0'],
116         'echonest': ['pyechonest'],
117         'lastgenre': ['pylast'],
118         'mpdstats': ['python-mpd'],
119         'web': ['flask', 'flask-cors'],
120         'import': ['rarfile'],
121         'thumbnails': ['pathlib', 'pyxdg'],
122         'metasync': ['dbus-python'],
123     },
124     # Non-Python/non-PyPI plugin dependencies:
125     # convert: ffmpeg
126     # bpd: pygst
127 
128     classifiers=[
129         'Topic :: Multimedia :: Sound/Audio',
130         'Topic :: Multimedia :: Sound/Audio :: Players :: MP3',
131         'License :: OSI Approved :: MIT License',
132         'Environment :: Console',
133         'Environment :: Web Environment',
134         'Programming Language :: Python :: 2',
135         'Programming Language :: Python :: 2.7',
136     ],
137 )
138
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -105,7 +105,7 @@
         'responses',
         'pyxdg',
         'pathlib',
-        'python-mpd',
+        'python-mpd2',
     ],
 
     # Plugin (optional) dependencies:
@@ -115,7 +115,7 @@
         'discogs': ['discogs-client>=2.1.0'],
         'echonest': ['pyechonest'],
         'lastgenre': ['pylast'],
-        'mpdstats': ['python-mpd'],
+        'mpdstats': ['python-mpd2'],
         'web': ['flask', 'flask-cors'],
         'import': ['rarfile'],
         'thumbnails': ['pathlib', 'pyxdg'],

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -105,7 +105,7 @@\n         'responses',\n         'pyxdg',\n         'pathlib',\n-        'python-mpd',\n+        'python-mpd2',\n     ],\n \n     # Plugin (optional) dependencies:\n@@ -115,7 +115,7 @@\n         'discogs': ['discogs-client>=2.1.0'],\n         'echonest': ['pyechonest'],\n         'lastgenre': ['pylast'],\n-        'mpdstats': ['python-mpd'],\n+        'mpdstats': ['python-mpd2'],\n         'web': ['flask', 'flask-cors'],\n         'import': ['rarfile'],\n         'thumbnails': ['pathlib', 'pyxdg'],\n", "issue": "python-mpd is old and crusty, beets should start using python-mpd2\nAssuming that at some point in time `beets` needs to run on Python 3 (which it does eventually, because Python 2 is being phased out), there will be an issue concerning `python-mpd`; `python-mpd` is not compatible with Python 3, nor is it really even maintained upstream anymore. The [last update was in December of 2010](https://pypi.python.org/pypi/python-mpd/), and it's website is down as well.\n\n[`python-mpd2`](https://github.com/Mic92/python-mpd2), however, is maintained and sees fairly active development. It is a fork of `python-mpd`, and has [a document explaining porting](https://github.com/Mic92/python-mpd2/blob/1c7e8f246465110ccb2d64df829c6dbdcdc74c9e/doc/topics/porting.rst) from `python-mpd` on the repository. Aside from the stickers API, which I'm not even sure `beets` uses, it looks fairly easy to replace.\n\nI think that it would be better to use python-mpd2 for these reasons. Any thoughts?\n\n", "before_files": [{"content": "#!/usr/bin/env python\n\n# This file is part of beets.\n# Copyright 2015, Adrian Sampson.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n\nfrom __future__ import division, absolute_import, print_function\n\nimport os\nimport sys\nimport subprocess\nimport shutil\nfrom setuptools import setup\n\n\ndef _read(fn):\n    path = os.path.join(os.path.dirname(__file__), fn)\n    return open(path).read()\n\n\ndef build_manpages():\n    # Go into the docs directory and build the manpage.\n    docdir = os.path.join(os.path.dirname(__file__), 'docs')\n    curdir = os.getcwd()\n    os.chdir(docdir)\n    try:\n        subprocess.check_call(['make', 'man'])\n    except OSError:\n        print(\"Could not build manpages (make man failed)!\", file=sys.stderr)\n        return\n    finally:\n        os.chdir(curdir)\n\n    # Copy resulting manpages.\n    mandir = os.path.join(os.path.dirname(__file__), 'man')\n    if os.path.exists(mandir):\n        shutil.rmtree(mandir)\n    shutil.copytree(os.path.join(docdir, '_build', 'man'), mandir)\n\n\n# Build manpages if we're making a source distribution tarball.\nif 'sdist' in sys.argv:\n    build_manpages()\n\n\nsetup(\n    name='beets',\n    version='1.3.14',\n    description='music tagger and library organizer',\n    author='Adrian Sampson',\n    author_email='adrian@radbox.org',\n    url='http://beets.radbox.org/',\n    license='MIT',\n    platforms='ALL',\n    long_description=_read('README.rst'),\n    test_suite='test.testall.suite',\n    include_package_data=True,  # Install plugin resources.\n\n    packages=[\n        'beets',\n        'beets.ui',\n        'beets.autotag',\n        'beets.util',\n        'beets.dbcore',\n        'beetsplug',\n        'beetsplug.bpd',\n        'beetsplug.web',\n        'beetsplug.lastgenre',\n        'beetsplug.metasync',\n    ],\n    entry_points={\n        'console_scripts': [\n            'beet = beets.ui:main',\n        ],\n    },\n\n    install_requires=[\n        'enum34>=1.0.4',\n        'mutagen>=1.27',\n        'munkres',\n        'unidecode',\n        'musicbrainzngs>=0.4',\n        'pyyaml',\n        'jellyfish',\n    ] + (['colorama'] if (sys.platform == 'win32') else []) +\n        (['ordereddict'] if sys.version_info < (2, 7, 0) else []),\n\n    tests_require=[\n        'beautifulsoup4',\n        'flask',\n        'mock',\n        'pyechonest',\n        'pylast',\n        'rarfile',\n        'responses',\n        'pyxdg',\n        'pathlib',\n        'python-mpd',\n    ],\n\n    # Plugin (optional) dependencies:\n    extras_require={\n        'fetchart': ['requests'],\n        'chroma': ['pyacoustid'],\n        'discogs': ['discogs-client>=2.1.0'],\n        'echonest': ['pyechonest'],\n        'lastgenre': ['pylast'],\n        'mpdstats': ['python-mpd'],\n        'web': ['flask', 'flask-cors'],\n        'import': ['rarfile'],\n        'thumbnails': ['pathlib', 'pyxdg'],\n        'metasync': ['dbus-python'],\n    },\n    # Non-Python/non-PyPI plugin dependencies:\n    # convert: ffmpeg\n    # bpd: pygst\n\n    classifiers=[\n        'Topic :: Multimedia :: Sound/Audio',\n        'Topic :: Multimedia :: Sound/Audio :: Players :: MP3',\n        'License :: OSI Approved :: MIT License',\n        'Environment :: Console',\n        'Environment :: Web Environment',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n    ],\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\n# This file is part of beets.\n# Copyright 2015, Adrian Sampson.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n\nfrom __future__ import division, absolute_import, print_function\n\nimport os\nimport sys\nimport subprocess\nimport shutil\nfrom setuptools import setup\n\n\ndef _read(fn):\n    path = os.path.join(os.path.dirname(__file__), fn)\n    return open(path).read()\n\n\ndef build_manpages():\n    # Go into the docs directory and build the manpage.\n    docdir = os.path.join(os.path.dirname(__file__), 'docs')\n    curdir = os.getcwd()\n    os.chdir(docdir)\n    try:\n        subprocess.check_call(['make', 'man'])\n    except OSError:\n        print(\"Could not build manpages (make man failed)!\", file=sys.stderr)\n        return\n    finally:\n        os.chdir(curdir)\n\n    # Copy resulting manpages.\n    mandir = os.path.join(os.path.dirname(__file__), 'man')\n    if os.path.exists(mandir):\n        shutil.rmtree(mandir)\n    shutil.copytree(os.path.join(docdir, '_build', 'man'), mandir)\n\n\n# Build manpages if we're making a source distribution tarball.\nif 'sdist' in sys.argv:\n    build_manpages()\n\n\nsetup(\n    name='beets',\n    version='1.3.14',\n    description='music tagger and library organizer',\n    author='Adrian Sampson',\n    author_email='adrian@radbox.org',\n    url='http://beets.radbox.org/',\n    license='MIT',\n    platforms='ALL',\n    long_description=_read('README.rst'),\n    test_suite='test.testall.suite',\n    include_package_data=True,  # Install plugin resources.\n\n    packages=[\n        'beets',\n        'beets.ui',\n        'beets.autotag',\n        'beets.util',\n        'beets.dbcore',\n        'beetsplug',\n        'beetsplug.bpd',\n        'beetsplug.web',\n        'beetsplug.lastgenre',\n        'beetsplug.metasync',\n    ],\n    entry_points={\n        'console_scripts': [\n            'beet = beets.ui:main',\n        ],\n    },\n\n    install_requires=[\n        'enum34>=1.0.4',\n        'mutagen>=1.27',\n        'munkres',\n        'unidecode',\n        'musicbrainzngs>=0.4',\n        'pyyaml',\n        'jellyfish',\n    ] + (['colorama'] if (sys.platform == 'win32') else []) +\n        (['ordereddict'] if sys.version_info < (2, 7, 0) else []),\n\n    tests_require=[\n        'beautifulsoup4',\n        'flask',\n        'mock',\n        'pyechonest',\n        'pylast',\n        'rarfile',\n        'responses',\n        'pyxdg',\n        'pathlib',\n        'python-mpd2',\n    ],\n\n    # Plugin (optional) dependencies:\n    extras_require={\n        'fetchart': ['requests'],\n        'chroma': ['pyacoustid'],\n        'discogs': ['discogs-client>=2.1.0'],\n        'echonest': ['pyechonest'],\n        'lastgenre': ['pylast'],\n        'mpdstats': ['python-mpd2'],\n        'web': ['flask', 'flask-cors'],\n        'import': ['rarfile'],\n        'thumbnails': ['pathlib', 'pyxdg'],\n        'metasync': ['dbus-python'],\n    },\n    # Non-Python/non-PyPI plugin dependencies:\n    # convert: ffmpeg\n    # bpd: pygst\n\n    classifiers=[\n        'Topic :: Multimedia :: Sound/Audio',\n        'Topic :: Multimedia :: Sound/Audio :: Players :: MP3',\n        'License :: OSI Approved :: MIT License',\n        'Environment :: Console',\n        'Environment :: Web Environment',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n    ],\n)\n", "path": "setup.py"}]}