From 12136e1d32fc340104ce0315caeface741fdf48e Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Thu, 16 Jun 2016 23:59:51 -0400 Subject: [PATCH] adapt is_url checking for bytestring paths --- beetsplug/mpdstats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py index 2b6422942..b1a01b52e 100644 --- a/beetsplug/mpdstats.py +++ b/beetsplug/mpdstats.py @@ -40,9 +40,10 @@ mpd_config = config['mpd'] def is_url(path): """Try to determine if the path is an URL. """ + if isinstance(path, bytes): # if it's bytes, then it's a path + return False return path.split('://', 1)[0] in ['http', 'https'] - # Use the MPDClient internals to get unicode. # see http://www.tarmack.eu/code/mpdunicode.py for the general idea class MPDClient(mpd.MPDClient):