Possibly fix #1805: bytes headers for requests

This commit is contained in:
Adrian Sampson 2016-01-11 10:30:33 -08:00
parent 231981de0c
commit 8cb545b779
2 changed files with 4 additions and 2 deletions

View file

@ -72,9 +72,9 @@ def _logged_get(log, *args, **kwargs):
else:
message = 'getting URL'
req = requests.Request('GET', *args, **req_kwargs)
req = requests.Request(b'GET', *args, **req_kwargs)
with requests.Session() as s:
s.headers = {'User-Agent': 'beets'}
s.headers = {b'User-Agent': b'beets'}
prepped = s.prepare_request(req)
log.debug('{}: {}', message, prepped.url)
return s.send(prepped, **send_kwargs)

View file

@ -47,6 +47,8 @@ Fixes:
(like the :ref:`modify-cmd` command). :bug:`1804`
* The :ref:`stats-cmd` command no longer crashes when files are missing or
inaccessible. :bug:`1806`
* :doc:`/plugins/fetchart`: Possibly fix a Unicode-related crash when using
some versions of pyOpenSSL. :bug:`1805`
.. _beets.io: http://beets.io/
.. _Beetbox: https://github.com/beetbox